Log In  

Cart #platformer_demo-0 | 2020-08-15 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
3


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

P#80828 2020-08-15 21:27


[Please log in to post a comment]