Game Development Reference
In-Depth Information
r]n^qhhap6>qhhap9jas>qhhap$^qhhap[Rt(^qhhap[Ru(^qhhap[Op]npT( ±
The robot now fires randomly between 200 and 1200 milliseconds.
Using other player control systems
When I introduced the example of Button Fairy's mouse control scheme, I mentioned that it was an
everything-but-the-kitchen-sink example. You can rip it apart, take what you need, and build your own
system to meet the needs of whatever kind of game you're designing.
However, it might not always be that obvious as to how to go about making a control scheme that's
more specialized, especially if you're new to programming. To help you out, in the chapter's source
files I included two more complete examples of player control systems that you're free to use and
modify for the basis of any of your games:
Keyboard-controlled spaceship is in a folder called Ol]_aodel. It uses the basic techniques
outlined in this chapter to control a spaceship. Use the left and right arrow keys to turn, the up
arrow keys for thrust, and the spacebar to shoot. Figure 10-21 shows an example. With very
little work, you can also turn this into a control scheme for an overhead car driving game.
Figure 10-21. Keyboard controlled spacehip
Search Nedrilad ::

Custom Search