Game Development Reference
In-Depth Information
The formula for determining velocity, where d = displacement and
t = time, is as follows:
v
=
d / t
Acceleration
If we change the velocity of an object over time (whether increas-
ingordecreasing),wecreatethatobject
s acceleration . For sake of
clarity, acceleration can be either a positive or negative change, but
we usually refer to an acceleration that results in a lower velocity,
or slowing down, as a deceleration. The formula for acceleration,
where v = velocity and t = time is as follows:
'
a
=
v / t
A naturally occurring example of acceleration that we are all
familiar with is that of gravity, the force pulling us downward
toward Earth
'
s center. The magnitude of gravity on Earth is
approximately 9.8 m/s.
Friction
When two surfaces are in contact with each other, the resistance
between the two is known as friction. Each surface has a property
unique to it known as the coefficient of friction .Simplyput,it
describes the smoothness or roughness of a surface; the higher the
number, the more friction that surface generates. Sandpaper, for
example, would have a much higher coefficient of friction than a
material like ice. The energy that is lost due to friction is converted
to heat, which explains why rubbing your hands together even-
tually warms them. However, for our purposes, all you really need
to understand about friction is its degrading effect on velocity and
acceleration. An object
s coefficient of friction often has to be deter-
mined through trial and error when programming. For instance,
the value for the friction of a rolling ball in the real world might
not work effectively in a game. The important thing to remember is
that none of the values must be set in stone
'
you can change
them as needed to suit gameplay.
Inertia
The counterpart to friction, inertia is an object
sresistancetoa
change that causes it to either want to stay at rest or keep moving.
Without friction, static objects would never be able to gain traction,
thus remaining still, and moving objects would never be able to
come to a stop. You can feel the sensation of inertia when inside
an elevator or a vehicle that comes to a sudden stop; your body
can feel for a moment like it is still moving.
'
Search Nedrilad ::




Custom Search