We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hello All,
I am in the early stages of making a platformer style game. I have run into some confusion when trying to add multiple platforms.
I have a single Platform along the bottom of the screen as the "ground" for the game and a Sprite that rests on top of it. I have successfully programmed the Sprite to move left or right when the player pushes the arrow keys and to jump when the player pushes the space bar. There is a boolean "connected" in my Sprite class which I use to make the Sprite fall down when not connected to a platform. The connection between my Sprite and the Platform is done using a box-style intersection.
I want to add in a second platform that allows the player to jump from the "ground" to the new platform. I write the code exactly as before but run into a problem when the player actually lands on the new platform. The jump functionality no longer works. I can still move left or right and the Sprite still falls when the player moves off the edge of the platform, but when I press the space bar nothing happens. I have checked my boolean "connected" value when on the new platform and it is showing a value of true.
I'm not totally sure what's wrong. If anyone has any examples or tutorials for making a platformer that deals with this problem I would be very grateful.
Thank you for any help.
Answers
Please post your code(preferably the important parts) to get better help.