Game Development Reference
In-Depth Information
After this bonus code, a check is used to see if bonusScore should be set to true for future scoring. The result will
be true in only one scenario, when the current category button's name is “fakezee” and it resulted in a score of 50.
This brings us to the end of the code for Fakezee. For your convenience, the entire game logic is available in
the fakezee . js file available with the other source code from the Source Code/Downloads tab on this topic's Apress
product page ( www.apress.com/9781430263401 ) .
Summary
With the power of CreateJS, a fully enjoyable game, complete with polished graphics and animations was built with
a fairly small amount of code. By using a sprite sheet, several graphics, including animated ones, were added to the
game, each with only a single line of code. This sprite sheet's large, corresponding object was tucked away into its
own JSON file and loaded in to keep from polluting the game logic code. The extensive scoring logic was also written
separately in a highly organized, self-contained manner by encapsulating it into a class-like object.
At this point in the topic, a major portion of the EaselJS API and how it pertains to games has been covered.
For the second half of the topic, we'll be taking this further with better programming techniques, performance
optimizations, and the extra polish that will take your games to the next level. In the next chapter, you'll learn to
further organize your game by creating custom containers and sprites that contain custom behaviors.
 
Search WWH ::




Custom Search