This is a very basic demo of a platform game. I was struggling with slopes etc, until I had this idea. It works quite well, so I wanted to share it with you.
Whereever the player is, the program looks for the first pixel directly under it, starting from the head. It looks directly in the spritesheet. If the player is falling down, its y-value cannot get below the floor level.
This works really well for the slopes, but sometimes if you jumped and your head peeped over a platform, the player teleported to the platform above. I fixed this by checking from the player's feet, when jumping or falling.
Bye,
Kim
[Please log in to post a comment]