Let’s Play! Scripting the Game

  • Allan Fowler
  • Philip Chu
Chapter

Abstract

Your bowling game that has been taking shape over the past few chapters is starting to actually look like a bowling game! It has a bowling ball, bowling pins (or rather, the barrels added in the previous chapter), game controls, and game physics. But it’s still more a toy than a game since it lacks game rules and scoring. That will be remedied in this chapter with a healthy dose of scripting. Most of that will take place in the game controller script, FuguBowlPlayer.js, which will be filled out with the complete logic for a bowling game laid out as states in a finite state machine (FSM). The scoring rules are complicated, so those will be encapsulated in a script named FuguBowlPlayer.js.

Copyright information

© Allan Fowler and Philip Chu 2017

Authors and Affiliations

  • Allan Fowler
    • 1
  • Philip Chu
    • 2
  1. 1.MariettaUSA
  2. 2.Apt 110Huntington BeachUSA

Personalised recommendations