PDA

View Full Version : gravity the ground and making a mech move



morgansaysthis
November 14th, 2006, 03:23 PM
i cant find a good tutorial on how to land on oddly shaped ground or platforming much at all
im making a platformish game withfollowing the mouse for shooting, nothing special and i didnt think it would be hard but i cant find a platform tutorial that dosent have the char landing on boxs or flat ground,

so i tried an idea i heard from my friend about invisible movie clips to detect collision so i gave it a shot and it worked

i have one invisible boundary the stops left motion and another that stops right motion and another that stops downward motion and i put the on corresponding sides of the wall or ground and it works great but with one problem

the little vehicle animation i have sinks into the ground or wall just barely and then pushs itself back out, you almost cant tell but it looks really sloppy

has anyone else run into this problem


how do you guys deteced collision and stop downward or right left motion and still inculding gravity and friction(friction char slides a little bit more after you let go of the key)

when i get my laptop out later ill post all my code

Thinker2501
November 15th, 2006, 06:52 PM
When I do collision detection I do the detection each frame before I move the character. I ad whatever motion is going to be used to the character's current position and check to see if the new position will cause a collision, if it will then i find out how far the character can move without colliding. The character is then moved to that new position. This way when the character is going to hit something he ends up standing right next to it or on top of it.

I know that doesn't speak directly to collision on a curved surface, but that does give you a look at the theory. I believe Tonypa has a tutorial on vector (curved) terrain. There is a link to his site in the resources sticky.

morgansaysthis
November 15th, 2006, 07:57 PM
thanks a bunch ill try that and read throgh the tutorial

is the curvered terrain method simular??

TheCanadian
November 15th, 2006, 08:03 PM
http://www.harveycartel.org/metanet/tutorials/tutorialA.html