From a Game Story to a Real 2D Game

From a Game Story to a Real 2D Game

Chong-wei Xu (Kennesaw State University, USA) and Daniel N. Xu (University of Wisconsin at Milwaukee, USA)
DOI: 10.4018/978-1-4666-1634-9.ch015
OnDemand PDF Download:
$30.00
List Price: $37.50

Abstract

How does one design and implement a 2D game? Specifically, how does one teach students how to develop a game from an idea or a game story? A technical guide has been developed, which includes the modeling principle, the generic global software structure framework, and the incremental development strategy. The technical guide is introduced via the development of the example game Othello from a standalone version to a single player version and then to a networked version. The technical guide not only has been applied for gaming but also for implementing teaching tools with dynamic behaviors.
Chapter Preview
Top

Introduction

Games are an integration of Humanities, Mathematics, Physics, Artificial Intelligence, Animation, and graphical programming, just to name a few. Meanwhile, games are also industrial products. Many educational specialists have indicated that gaming is a good tool for education (Schollmeyer, J., 2006). Not only that, students gain real world industrial skills while they are learning. The variety of game genres plus the unlimited ways for implementing each game greatly encourages a student’s imagination and problem solving ability. In order to educate students not only as programmers but also as architects, a technical guide for developing games has been derived. This technical guide will help guide students to model, design, and implement games following certain important principles. This chapter intends to introduce this technical guide by taking an easily described game Othello as an example.

This technical guide includes a model and a generic global software structure framework. The model is an abstraction of the common features of different genres of games, as shown in Figure 1. The abstraction emphasizes the separation of the GUI (Graphical User Interface) from the logic as well as the synchronization of the two units based on data passing. This model promotes the analysis of a game and the synthesis of the system, which is especially important when developing a networked game, where the data passed along networks for synchronizing the GUI and the logic is the key to its success. As Figure 1 illustrates, the model says that a game has a special GUI for displaying the scenes of the game. The GUI consists of so-called sprites, which are components animated independently. Another unit, the game logic unit, controls the animations and GUI. The movement of the sprites is controlled externally by those playing the game. The movements may cause collisions among sprites, which might further trigger a new piece of logic to change the structure and format of the sprites in the GUI. Even though different games may have different stories, sets of sprites, control logic, and numbers of players, the same model can be used to represent the majority of games.

Figure 1.

An abstract model of games

Figure 1 indicates that the GUI of a game consists of GUI components, which are the sprites. The logic of a game refers to a set of states combined with certain units of artificial intelligence. All sprites should be held by data structures and the game logic should be defined by a state diagram. These two units are synchronized through the communication mechanism via the passing of the input states and the output states. These input states and output states are associated with the players’ external actions and game’s internal functions.

Figure 1 also reveals the fact that although games exist in hundreds of thousands of various forms, they share some common principles, which include certain specific OOP (Object-Oriented Programming) principles and general software principles. Following these principles, a global software structure called the three-layer framework for gaming has been derived and will be included in the technical guide to help students in designing games. This structure and framework will be detailed in the next section.

The GUI of a game forms a main game screen. Meanwhile, several other screens are associated with the main game screen as illustrated in Figure 2. Every screen has its own special role, which is suggested by its name. These screens are part of the global software structure. However, this is beyond the scope of this chapter.

Figure 2.

Multiple screens associated with a game

Complete Chapter List

Search this Book:
Reset