Basic Platformer Example

BlitzMax Forums/BlitzMax Beginners Area/Basic Platformer Example

Chroma(Posted 2013) [#1]
Found this really cool tutorial on concepts of a basic platformer. In my spare time (aside from my Monkey iPad game coding), I plan to port this to BMax.

http://www.hobbygamedev.com/adv/2d-platformer-advanced-collision-detection/


Chroma(Posted 2013) [#2]
Hmm...this looks interesting too. Quadtrees for 2d collision.

http://gamedev.tutsplus.com/tutorials/implementation/quick-tip-use-quadtrees-to-detect-likely-collisions-in-2d-space/


Wiebo(Posted 2013) [#3]
I like that first article, thanks!

I have a quadtree module for you here, should you wish to use one: http://code.google.com/p/noisycode/wiki/quadtree
I also intend to use it for big worlds with plaforms.


Chroma(Posted 2013) [#4]
Thanks Wiebo!


Mr Biscuit(Posted 2015) [#5]
I used a similar approach in a platformer I wrote in another Basic. It wasnt a game really, just an experiment with collision upon sloped and un-even ground.

I did 8 pixel checks around the sprite i.e. North, North East, East etc. The bottom checks - South West & South East looked for a non transparent part of a sprite. Once collision had occured I checked if the area 1,-1 (one pixel across , one up) was transparent. If this was the case I altered the Xdir and Ydir accordingly.

I did the following checks (0,1) (1,-1) (1,-2) (1,-2) (2,-2) which resulted in a realisitc looking walk along terrain.

I eventually created a TYPE containg image,x, y, Cos value and Sin values.
When the player collided with the image I altered the players xdir & ydir to the Cos and Sin values associated with it. The player sprite was then rotated after comparing its current angle to the collison values This resulted in a Sonic style looking game.