LoginLogin
Nintendo shutting down 3DS + Wii U online services, see our post

Making a platformer

Root / Programming Questions / [.]

UltraPhoenix4Created:
So... I've been tinkering with some code to try and make a platformer. No results. Does anyone have any sample code to give me or some hints?

I have a tips: bg colisin sux In a more serious tone, if your character starts to float a few pixels into or above blocks, use 16*FLOOR(<y or x>/16) or something like this if the character has little or no velocity in that direction. It worked for me when I tried making a platformer, my character wouldn't glitch into blocks after I tried it :D
  • Also, use separate values for velocity and coordinates.
  • Check collision on all the sprite corners, not sides. That way you don't clip into blocks from certain angles.
  • Keep code neat! Break it into groups like 'physics, display, input' etc. Hopefully this helped? My own platformer was broken because I lost track of what did what but if you document your code you can probably do a good job.
  • So also document your code. Also, on an offtopic note... using the LIST formatting option doesn't actally require [.list] around it, just using [.*] works :D

  • How do you check sprite corners? Is it pretty complicated?