Chapter 4. 2D Game Engine
Finally, the good stuff! The first three chapters of this book introduced the basics involved in programming for the iPhone and the concepts behind a game engine. We even laid out a nice framework to get us started. All that’s left is to make our game…but wait, aren’t we forgetting something? What kind of game are we going to make? Before we start coding away, we need to have a plan. We need a game design.
Game Design
The first step in coming up with a good game design is brainstorming. What will the game look like, and how will it feel to play the game? What are the goals, and how will you keep players entertained? Remember that as much fun as it is to make a game, the end result needs to be something that’s fun to play.
To begin, we’ll need to keep in mind the special considerations of the iPhone:
Touch-screen input
Limited resolution and memory
Play sessions that are short and can be interrupted at any time by a phone call
This means we need to come up with a design that incorporates:
A simplistic input scheme
Efficient use of memory for graphics and sound
Game play that is broken into short segments that can easily be stopped and resumed
To fulfill all of these requirements, we will create a 2D tile-based engine. Tile-based means the level background will be composed of a limited number of square tiles that are repeated and put together to form the level (this allows us to create a large level that uses only a small amount of texture memory). Most 2D games are ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access