Beginning HTML5 Games with CreateJS

Book description

Beginning HTML5 Games with CreateJS provides a hands-on approach to get you up and running with the most comprehensive tools available for HTML5 Canvas game development. Whether you are brand new to making games or an experienced game developer, you'll learn to fully utilize the CreateJS suite to bring your new or existing game techniques to desktop and mobile devices.

This book covers everything from creating graphics in HTML5 Canvas to capturing user input (whether from keyboard, mouse, or touch) to using a state machine for efficient game control. There are practical (and fun) examples throughout the book, with four full game projects, including a mobile RPG. The book also covers optimizing your games for mobile and publishing them to app stores.

HTML5 games are growing more and more popular, and the demand for HTML5 Canvas skills is on the rise. The CreateJS suite is a powerful toolset that will help you manage Canvas drawing and animations, asset loading, sound management, complex tweening, and much more. Using these robust libraries, you can build powerful and engaging games that reach a wide range of audiences and devices.

What you'll learn

  • HTML5 Canvas drawing and animations using EaselJS and TweenJS

  • Loading and managing assets using PreloadJS

  • Sound management using SoundJS

  • Core game development techniques such as state machines and object pooling

  • Extending EaselJS DisplayObjects using object-oriented JavaScript

  • JavaScript debugging

  • Wrapping HTML5 games and publishing them to app store

  • Who this book is for

    Beginning HTML5 Games with CreateJS is written for both the new and experienced game developer. It covers an in-depth look at the APIs in each part of the CreateJS suite, and teaches you how to use them in game development scenarios. If you're an experienced developer it will show you how to take your existing gaming techniques and learn how to apply them to the HTML stack using object-oriented programming in JavaScript. Beginning HTML5 Games with CreateJS is a must-read book for anybody wanting to learn more about HTML5 game development using this extremely popular suite of tools.

    Table of contents

    1. Title Page
    2. Dedication
    3. Contents at a Glance
    4. Contents
    5. About the Author
    6. About the Technical Reviewer
    7. Acknowledgments
    8. Introduction
    9. CHAPTER 1: Getting to Know CreateJS
      1. Getting Started
      2. EaselJS
      3. TweenJS
      4. SoundJS
      5. PreloadJS
      6. Dancing Butterflies
      7. Summary
    10. CHAPTER 2: Making and Animating Graphics
      1. Stage
      2. Creating Graphics
      3. Drawing UI Elements
      4. Summary
    11. CHAPTER 3: Capturing User Input
      1. Mouse Events
      2. Color Drop
      3. Keyboard Events
      4. Text
      5. Word Game
      6. Summary
    12. CHAPTER 4: Game Project: Progressive Break-it
      1. Progressive Break-it
      2. Setting Up the Project Files
      3. Beginning the Game Code
      4. Building the Game Elements
      5. Adding the Controls
      6. Creating Levels
      7. Rendering the Game Elements
      8. Evaluating the Game
      9. Summary
    13. CHAPTER 5: Using and Managing Bitmap Images
      1. Bitmaps
      2. Puzzle Swap
      3. Containers
      4. Veggie Match
      5. Summary
    14. CHAPTER 6: Sprites and Sprite Sheet Animations
      1. Sprite Sheets
      2. Bitmap Fonts
      3. Sprite Sheet Animations
      4. Summary
    15. CHAPTER 7: Game Project: Fakezee
      1. Fakezee
      2. Reviewing the Sprite Sheet Files
      3. Beginning the Game Code
      4. Initializing the Game
      5. Revealing the Game Elements
      6. Playing the Rounds
      7. Scoring on Categories
      8. Evaluating the Game
      9. Calculating the Scores
      10. Using the Scoring Class
      11. Summary
    16. CHAPTER 8: Extending EaselJS Display Objects
      1. Inheritance
      2. Creating Reusable UI Components
      3. Creating Custom Sprites
      4. Running Man
      5. Summary
    17. CHAPTER 9: Sounds and Asset Management
      1. SoundJS
      2. Creating an Asset Manager Class
      3. Exploding Asteroids
      4. Summary
    18. CHAPTER 10: The State Machine and Scenes
      1. Deconstructing a State Machine
      2. Orb Destroyer
      3. Summary
    19. CHAPTER 11: Game Project: Space Hero
      1. Space Hero
      2. Preparing for the Project
      3. Creating the Sprites
      4. Creating the HUD
      5. Using Object Pools
      6. Creating the Scenes
      7. Creating the Game
      8. Summary
    20. CHAPTER 12: Building for Mobile Browsers
      1. Enabling Touch Events
      2. Setting the Viewport
      3. Scaling Fakezee for Multiple Screen Size
      4. Summary
    21. CHAPTER 13: Packaging and Compiling with PhoneGap Build
      1. Introducing PhoneGap Build
      2. Acquiring Developer Accounts For iOS and Android
      3. Updating the Fakezee Game For Packaging
      4. Preparing Assets for PhoneGap
      5. Submitting your Application to PhoneGap Build
      6. Summary
    22. CHAPTER 14: Game Project: The Villager RPG
      1. The Villager RPG
      2. Preparing for the Project
      3. Building the Game Data
      4. Building the Enemies and Hero
      5. Building the Game Menus
      6. Building the Game Level
      7. Building the Battle Win Screen
      8. Summary
    23. Index

    Product information

    • Title: Beginning HTML5 Games with CreateJS
    • Author(s):
    • Release date: March 2014
    • Publisher(s): Apress
    • ISBN: 9781430263401