Chapter 7. Sprite Behaviors

Topics in This Chapter

7.1 Behavior Fundamentals

7.2 Runner Behaviors

7.3 The Runner’s Run Behavior

7.4 Flyweight Behaviors

7.5 Game-Independent Behaviors

7.6 Combine Behaviors

7.7 Conclusion

7.8 Exercises

Great stories have great characters. And like books and movies, video games also need characters with interesting behaviors. For example, the protagonist in Braid—one of the most popular platform games of all time—can manipulate time. That ingenious behavior set the game apart from its contemporaries.

Behaviors are the soul of any video game, and adding behaviors to Snail Bait’s inert sprites immediately makes the game more interesting, as shown in Figure 7.1.

Figure 7.1 Sprites with behaviors

Get Core HTML5 2D Game Programming now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.