Download iPhone Game Development
Transcript
Furthermore, we will probably need to display some text for dialogs if our main character has anything interesting to say. Game progress So far, we’ve discussed only what goes on during game play. We will also need to add: • Code to link the levels together and show game progression • Something like a map that lets players choose what level to play next and unlocks new areas as they complete old ones Putting it all together, we have the following technical feature list: • • • • • A 2D tile-based render engine with scrolling capability Animated sprite entities for the main character, animals, and possibly level entities Functions to handle user input to control the main character Animal entity logic for several types of animals (such as lions, crocodiles, and emus) Physics to allow entities to move where they should, and not where they shouldn’t (such as into other entities) • Level logic to determine when goals have been met and to store the player’s progress through the game • A HUD for important information, including character dialogs • A menu that allows players to select what level to play and displays their progression through the game User Input Scheme As we mentioned earlier, the touch-screen feature of the iPhone means user input has to be a major focus of game design. Specifically, there are three problems that our game design should try to avoid. The first problem to avoid is requiring accurate touches. When a player touches the screen, she is actually touching many pixels at once; the iPhone will estimate the center pixel among those pixels and events will correspond to just that one pixel. It is important to make touchable interfaces (such as buttons) or in-game objects large enough that an inaccurate touch event will still find its mark if the player touched close enough. Therefore, we should use a rule of thumb (pun intended) that touchable objects should be at least 44 × 44 pixels. The second problem to avoid is causing the player to cover the screen with her hand while trying to use the screen for input. This is one of the major downsides to a touchscreen interface; because both input and output happen on the same surface, they end up fighting each other for space. One way to solve this is to require as little input from the user as possible. Another is to take user input only in nonessential parts of the Game Design | 99