HTML and CSS Reference
In-Depth Information
y = 0 for the edge is
The intersection point is then calculated by determining if the point where
between 0 and the translated actor destination point (see Figure 14-6 iv).
The intersection point is rotated and translated back.
If there is a result, then you have a contact and deal with it; if not, continue with the game loop.
Figure 14-6. How an intersection point is calculated
The line intersection physics system has worked very well and is very easy to use when it comes to designing
levels. The lines can be drawn onto a scene, delivering an instantly playable sketch of the level.
The system can help performance further with a number of precalculations based on acceleration from the
steepness of a slope and friction. These are imparted to connected actors. Every opportunity to take a calculation out
of a game loop should be taken. It is important to be a good “processor citizen.”
Note a line intersection physics system demo has been included with the code for this chapter. a line of connected
edges has been drawn, and a character drops on to it, walking to the edge and back. pressing a key or touching a
screen will stop the character. the artwork is a representation of me by my lovely daughters, eloisa and lola.
thanks, kids . . . i think.
Search WWH ::

Custom Search