Game Development Reference
In-Depth Information
Chapter 15
Sample Source Code
You have nearly come to the end of this topic; I hope you have had a good read and learned a
lot. In the first part of the topic I introduced you to Lua and its functions, and in the second part I
introduced you to the various Lua-based frameworks that you can use to develop for iOS devices.
This chapter will provide the complete source code for an application called Chopper Rescue, which
you can use as a base for creating your own games.
In Chopper Rescue, you are in control of a rescue chopper, with the goal of saving survivors. As
your chopper moves, you'll need to avoid various obstacles that can cause you to crash. When
survivors appear, your job is to collect them. In certain situations, you'll need to tap the screen to
shoot bullets; you can only shoot a certain number of bullets at any given time, so you must use this
feature carefully. The game is controlled using the accelerometer on the device.
This chapter contains details on how the game works. The complete source code can be
downloaded from the topic's page on apress.com . This source code is specifically designed for
Corona SDK and Gideros Studio only.
Graphics
When you begin designing a game, the second thing after coming up with a wonderful idea is
creating graphics. For the Chopper Rescue game, I had an idea of what I needed, but not having
access to a graphic artist, I drew some images by hand and scanned them. Figure 15-1 shows what
I came up with, and Figure 15-2 shows the resulting sprite sheet.
349
 
Search WWH ::




Custom Search