The first thing I noticed is you have defined Player:bounds() twice, once in main.lua and once in Player.lua. I commented out the implementation in main.lua.
Then inside your commented code you have this block:
Code: Select all
-- level stuff
if Level < 10 and Level ~= 10 then
Player.boundDirection = "up"
elseif Level == 10 then
print("special")
Player.boundDirection = "special"
Player:bottomBlock(2, -1)
Player:topBlock()
Player:rightBlock(2, 1)
Player:leftBlock()
elseif Level > 10 and Level ~= 10 then
print("right")
Player.boundDirection = "right"
end
When you get to level 10 the boundDirection is set to "special", but you have no code to handle that. I changed it to this:
Code: Select all
-- level stuff
if Level < 10 then
Player.boundDirection = "up"
elseif Level >= 10 then
Player.boundDirection = "right"
end
And when you get to the level with the right facing arrow the player can move to the right (indefinitely it seems). Personally I wouldn't set this inside the player its self. In Platform_loader.lua you're setting all the positions of the objects for each level, I would also put the bound direction in there, since it's tied to the level anyway.