[A83] Re: Realistic Jumping


[Prev][Next][Index][Thread]

[A83] Re: Realistic Jumping




The easiest way is to use a gravity table, like Sqrxz does.  Simulating
gravity by real is simple, using basic physics:

y = vt + (1/2)at^2

Where y is the vertical position, v is the initial velocity, a is the
acceleration, and t is time.  For free fall, you use gravity as the
acceleration.  If you are dealing in meters, this is approximately -9.8 m/s.
Of course, since this is just a game, being accurate is not needed, and
attempting to get the math right would be troublesome anyway.  What you can
do is use this to build a table, like the one in Sqrxz.  Or just use/modify
that one.

When you jump, you start a jump counter.  Each frame of the jump, you add
the value in the table (there will be positive and negative values) to the
vertical coordinate of the object.  This allows you to quickly calculate
jumps without having to resort to fixed or floating point math.

There is nothing wrong with using semi realistic physics in games.  In fact,
it can be a lot of fun to do so.  It's really neat to implement a particle
system and use it for things like explosions, engine trails, sparks, etc.
You use basic physics, and it all works without much work.  But when you're
writing it in assembly language, and for a calculator, you don't want to go
to that kind of hassle.  It's much easier to just fake it all with some
tables.  Almost all video games written for say the Nintendo use such
methods.  Writing games is about making stuff happen in a believable manner.
If it looks and feels right, then it is right.

> How can you achieve realistic jumping in ASM? For example the penguin in
> Bill Nagels Penguin 83.






References: