Game Development Community

Limiting uneven ground in 2D

by andrewKRT · in Game Design and Creative Issues · 02/11/2012 (11:34 am) · 5 replies

greetings,

I dont know if this fits in the subforum, I guess it kinda does.

Ok, so I know its a trivial task to make ground "walkable" in a platformer, or a scroller game with even ground. But how to do this in a level that has uneven ground? ups and downs and crests and bumps....

any ideas ??

#1
02/11/2012 (2:19 pm)
Simple: Don't!

A trick you can use is to make the bumpy ground visual only, then use an invisible scene object with the actual colliders, and all straight lines.
#2
02/11/2012 (2:57 pm)
hi Ronny, thanks so much for the quick reply.

Yes that is one way I was already trying, but the issue is, that the shape of object collide poligon must be convex. which means it only works when doing bumps, hills, etc..but not little holes, dents, etc..

there must be a way im sure, mind you im a newbie here, so please forgive my ignorance :) im learning as much as i can every day !
#3
02/12/2012 (3:42 am)
I think the best way is multiple shapes with collision, but you'll have more answers posting in the engine-specific forum :)
#4
02/12/2012 (6:36 pm)
depends on how in depth you want to go, I usually alter my characters collision to walk over small bumps but you can have the computer get the angle of the surface and determine if that surface is walkable. I use a similar technique when making a platform character perform a wall jump or wall climb.
#5
02/12/2012 (9:36 pm)
cheers for the replies guys !!

Glenn : ill look into the angle thing...although I presume ill be in way over my head...got any advice with what to start ??

cheers

andrew