Game Development Reference
In-Depth Information
Math says that the length of a circle is twice the value of Pi, multiplied by the radius of the
circle , usually written as 2πr .
We know the radius of the circle we want the rocket to describe. It is the length of the line
we drew.
With that formula, we can get the length in pixels of that circle, also known as its circum-
ference. Let's say the line has a length of 100 pixels; this would mean the circle about to
be described by the rocket has a length (or circumference) of 628.3 pixels (2 * π * 100).
With the speed described in the vector (5, 0), we can determine how long it would take the
rocket to complete that pixel length. We don't need this to be absolutely precise; the last it-
eration will most likely move beyond that total length, but it's good enough for our pur-
poses.
Search WWH ::




Custom Search