thoughts, ideas, code and other things...

Friday, March 20, 2009

Gravity in 2d Games


I always wished to know how exactly do creators Mario, Contra and Kirby (Specially this one) program gravity. Having done with the s = ut + 0.5 * at^2 and such forumulae, I haven't yet made a perfect framework for simple gravity physics, bounces and collision reactions. But, here is an article from The Science Creative Quarterly - link that really satisfies me with a historic look and clever analysis of the gravity in Mario.

Some more places to checkout for game physics- -- good for .NET developers


Labels: ,


At July 29, 2010 at 8:36 AM , Anonymous Anonymous said...

You gotta be kidding me!
It's one of the easyest things to do.

For example:

VY = VY + 1

And when the player hits the ground we simply set VY back to 0.

I hope i could help even if this is old.

At July 29, 2010 at 6:55 PM , Blogger Abhishek Mishra said...

I really dont do linear falls as well :)

^^ Do you notice a complexity coming up there? when VY becomes too large, and actor goes way too below ground level, one way is to check for its next position, and make it stick to ground if it tries to go even below it in next move.

But anyways, using 2d physics engines makes more sense these days - they are extrememly impressibe!

At August 10, 2010 at 9:26 AM , Anonymous Anonymous said...

Yes. But you simply put him back to ground level before drawing him ;D
They did it that way in super mario. Thats for sure.
Btw, physics engines need to be coded too^^

At August 10, 2010 at 3:12 PM , Blogger Abhishek Mishra said...



Post a Comment

Subscribe to Post Comments [Atom]

<< Home