O'Reilly logo

Microsoft® XNA™ Unleashed: Graphics and Game Programming for Xbox 360 and Windows by Chad Carter

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 15. Finite State Machines and Game State Management

IN THIS CHAPTER

The next two chapters discuss artificial intelligence (AI). However, this chapter discusses our game engine structure as well. Using finite state machines (FSMs) is critical for believable objects. We discuss FSMs and how we can set up our game itself as an FSM as we structure our game.

Finite State Machine

A finite state machine (FSM) is a machine with a finite set of states. Maybe we should first talk about a state. We discussed this some in Chapter 11, “Creating a 2D Game,” where we created the SimpleGame. We had StartMenu, Scene, Won, and Lost as states the game could be in. The finite ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required