Leanpub Header

Skip to main content

Phaser Game Starter Kit Collection

16+ Classic Game Mechanics using Phaser v2 Gaming Framework

This is a collection game starter kits guiding you in developing games for Phaser v2.x.x APIs. Each chapter is easy to read, humorous approach to game development, these self-contained tutorials are perfect for novices, experienced full-stack programmers, or anyone creating single-player games with their own artwork and features.

The author is letting you choose the price you pay for this book!

Pick Your Price...
PDF
EPUB
WEB
25
Readers
710
Pages
154,882Words
About

About

About the Book

Start your own Game Studio!

  • 33 General Game Licenses are included in this book - a savings of $1,980 if purchased separately!

Phaser Game Starter Kit Collection (6th Edition) is a hands-on guide for making browser games using both Phaser Gaming Framework versions 2.6.2, and Community released editions. You may also purchase these chapters individually which includes both v2.x.x and v3.16+. This collection delves into 16+ greatest classical and popular game mechanics with 19 sub-genres (for a total of 35!). All are written in a fun and friendly style with completed projects and open-ended exercises that encourage you to build and include your own game assets and features. You’ll also download supporting tools to classify the book’s snippets and add your own modification. Phaser III Game Starter Kit Collection (a sister volume to this one exclusively for Phaser v3.16+) is similar to this book's Part II.

The Phaser Game Starter Kit Collection contains several sections. It starts with an Introduction into game perspective, modes, genres, workstation set-up, and generation tools. Part I demonstrates basic game mechanisms using Phaser Official and the community edition versions. Each chapter is a separate game mechanic -- 16+ for v2 (and the same 16+ starter-kits for Phaser v3.16+ in a separate sister volume)! This is a reference book; simply turn to the game chapter you'd like to create. In a matter of hours, you will have a working game prototype for that game mechanics using the Game Design System™ -- fully explained in the Phaser Game Design workbook (6th edition). You then add your own artwork and additional game features; over the next few days, you have your own completed game ready to deploy in the "apps" stores. I consider this a joint effort. You might consider this a joint effort: I am your game programmer and you are the game designer, artist, and marketer.

Phaser III Game Starter Kit Collection (a sister volume) is similar to this book's Part II but all the tutorials are written in Phaser3 in a second separate volume. Part IV is a massive collection of 59+ Flash ActionScript games just waiting for you to transpile from ActionScript 2/3 into Phaser v2.x.x. Part V is an excerpt from Phaser Multiplayer Gaming Systems; it holds all the starter kits essentials for multiplayer games using web sockets.

You’ll find detailed working examples, with dozens of illustrations and many concepts you can freely apply to your own bespoke gaming projects. All the source code annotations enhance the book’s explanation. 

If you prefer, you can buy individual chapters - sold separately on LeanPub.com or Amazon.com

 

What you’ll learn:

By the end of this workbook, you’ll have integrated into your own bespoke game designs:

  • Adopted processes for business project management and agile software development.
  • Organized a standard file structure for developing games in general;
  • Used a blank game template to scaffold further game projects;
  • Imported resources and game assets;
  • Displayed, animated and moved game avatars on various screen renderings;
  • Managed groups of game objects in v2.x.x;
  • Deployed heads-up display (HUD) on game scenes both inside and outside the canvas;
  • Used customized web fonts;
  • Incorporated multiple game-inputs (touch, multi-touch, accelerometer, mouse and keyboard);
  • Rendered several physics systems in v2.x.x;
  • Included graphics effects (gfx) (particle systems, rotations, fades, shaders and more);
  • Created and managed game phases;
  • Managed permanent game assets across game phases;
  • Optimized your game for various mobile devices;
  • Integrated 3rd-party scripts and web services for v2.x.x.
  • Deploy single- and multi-player games.
  • Web Sockets demystified for scalable massive online game deployments.

Who This Book Is For:

Students of -- and professionals in -- "game art and animations" with some experience in HTML5 and JavaScript who want to enhance -- or begin learning the essential techniques of game programming skills in Phaser's official and community editions v2.x.x. If you are interested in making browser games, especially for the mobile market, then Phaser Game Starter Kit Collection is a perfect choice.

Price

Pick Your Price...

Minimum price

$9.99

$65.00

You pay

$65.00

Author earns

$52.00
$

All prices are in US $. You can pay in US $ or in your local currency when you check out.

EU customers: prices exclude VAT, which is added during checkout.

...Or Buy With Credits!

Number of credits (Minimum 1)

1
The author will earn $12.00 from your purchase!
You can get credits monthly with a Reader Membership

Author

About the Author

Stephen Gose

Avatar is an adorable cartoon sketch of my wife. My 48th anniversary is this coming Sept 1, 2026!

Stephen Gose, Ph.D. Information Systems (honorary) (and second-generation German) is a retired Professor Emeritus with a 41-year career as a certified network engineer, and "Certified Cisco Academy Instructor" (CCAI) since 2002. He is listed in the Who's Who for Information Technology for his directly related work for the Internet backbones in the Caribbean, Netherlands, Israel, and Russia. He was awarded "Letters of Appreciation" from AT&T, and the German, Israeli, Dutch, and Russian Governments. Steve has nearly three decades of international "teaching and conference lecturing" in both Local-Area and Wide-Area Networks, network security, Internet backbones, software engineering, and program/project management. He is a retired US Army Signal Corps Officer. He earned, in 2014, the ITT Technical Institute's "Instructor of the Year" out of 8,000 instructors across 144 campuses throughout the USA. 

He graduated from Grand Canyon University with his first B.A. in Religions and Music Education, then a B.S. in Business Admin. from the University of Maryland, and an M.B.A. in International Management from Liberty University.

He is currently pursuing his Th.D. He has been a licensed minister since 1972 and a missionary to Okinawa, Japan. He earned the US Army Chaplain Outstanding Service Award in 1983. 

In his spare time(?), Steve enjoys creating online casual games, software engineering, and managing his online gaming businesses. 

My driving theme: "Always stay humble and kind"

His website is: https://www.Stephen-Gose.com/

His game showcase is: http://www.renown-games.com

His theology website: http://kingdomofgodprinciples.com/

Game Support Site: http://makingbrowsergames.com/

Review my profile on LinkedIn.com: https://www.linkedin.com/in/stephen-gose/

Contents

Table of Contents

Distribution Permission

  1. Supporting website

Disclosures

Disclaimer

Forwards

About this Workbook

  1. Links and References

Workbook Content

  1. How to Read & Use this workbook:
  2. Viewing the eBook’s Source Code:
  3. Who should use this workbook?

Your newly obtained skills…

Game Design System™

  1. Game Studio - Book Series
  2. Game Studio - Online Courses
  3. “Making Browser Games” - Books Series
  4. “Making Browser Games” Series - online Courses
  5. Programming Courses
  6. “Walk-Thru Tutorial” Series - Online Courses
  7. IPart I - Introduction

1Introduction

  1. 1.1Game Component Perspectives
  2. 1.2Game Delivery Modes
  3. 1.2.1Game Mode - Single-Player Flowchart
  4. 1.2.2Game Mode - Multi-Player Flowchart
  5. 1.3Game Genres
  6. GG Interactive — Game Design Course
  7. 1.3.1Action Games
  8. 1.3.2Adventure Games
  9. 1.3.3Casino Games
  10. 1.3.4Educational Games
  11. 1.3.5Fighting Games
  12. 1.3.6Platform Games
  13. 1.3.7Puzzle Games
  14. 1.3.8Racing Games
  15. 1.3.9Rhythm / Music Game
  16. 1.3.10Role-Playing Games (RPG)
  17. 1.3.11Shooter Games
  18. 1.3.12Simulations
  19. 1.3.13Sports Games
  20. 1.3.14Strategy Games
  21. 1.3.15Tower Defense™ — USPTO awarded to COM2US
  22. 1.4Mind The Gap
  23. 1.5Game Tools & Generators
  24. 1.6Standard Project Setup
  25. 1.6.1Standardized File Structure
  26. 1.7Game Recipe™
  27. 1.7.1Development:
  28. 1.7.2Design:
  29. 1.7.3Encoding:
  30. 1.8Creating Prototype Mechanisms — “4-step method”
  31. 1.8.1Standard Game Index Page (formal method)
  32. 1.8.2Mobile Apps: Game.js (aka Main.js)
  33. 1.9Game Shell and Logic Flow
  34. 1.9.1Network Impact
  35. 1.9.2Gamer’s Local Activity
  36. 1.9.3Generic Main.js
  37. 1.9.4Generic Boot.js
  38. 1.9.5Generic Preload.js
  39. 1.9.6Generic Splash.js or Language.js
  40. 1.9.7Generic Menu.js
  41. 1.9.8Sample CMS page — Credits.js
  42. 1.9.9Play.js
  43. 1.9.10Inside each Game Phase
  44. 1.10Plug-in Enhancements
  45. 1.11Introduction References
  46. IIPart II - Game Mechanics

2Action-Arcade Mechanics

  1. 2.1Reference From
  2. 2.2Overview
  3. 2.3Our Goal
  4. 2.4Game Mechanics
  5. The Six Seven Laws Of “Attention”
  6. 2.4.1Historical background
  7. 2.5Game Examples
  8. 2.5.1Official Phaser Examples
  9. 2.6Game Recipe™ Featured Ingredients
  10. 2.7Starting an Action-Arcade Game Project
  11. 2.7.1Step 0: Review Game demonstrations
  12. 2.7.2Step 1: Create your “front-door”
  13. 2.8Action-Arcade — Core Game Phases
  14. 2.8.1Step 2. Create Your Standard Game Shell Phases.
  15. 2.8.2Main.js
  16. 2.8.3Boot.js
  17. 2.8.4Preload.js
  18. 2.8.5Splash.js or Language.js
  19. 2.8.6Menu.js
  20. 2.9Action-Arcade Core Mechanics
  21. 2.10Design Considerations
  22. 2.10.1Gameboard Development
  23. 2.10.2Right or Left-handed?
  24. 2.10.3Cursor Keys: Timing vs. Movement
  25. 2.11Rhythm Game Logic & Supporting Functions
  26. 2.11.1Play.js
  27. 2.12Rhythm Core Game Mechanics
  28. 2.12.1Step 3. Create your core game logic & supporting functions
  29. 2.12.2hud.js Modifications
  30. 2.12.3billboard.js Modifications
  31. © Copyright 2010, Stephen Gose LLC
  32. 2.12.4constants.js Modifications
  33. 2.12.5game.js Modifications
  34. Design Option #1:
  35. Cheating Prevention added
  36. 2.12.6notes.js Modifications
  37. Recycling Sprites References
  38. 2.12.7banjostrings Modifications
  39. 2.13Prototype (Stage 1)
  40. 2.14Conclusion

3Adventure & RPG Game Mechanics

  1. 3.1Reference From:
  2. 3.2Overview
  3. 3.3Our Goal
  4. 3.4Game Mechanics
  5. 3.4.1Historical Background Reviewed
  6. 3.4.2Game Genre Components
  7. 3.5Game Examples
  8. 3.6Game Recipe™ Featured Ingredients
  9. 3.7Starting the Adventure project
  10. 3.7.1Step 0: Review your competition and game demonstrations:
  11. 3.7.2Step 1. Create your standard index file.
  12. 3.7.3Step 2. Create Your Standard Game Shell Phases.
  13. 3.7.4Main.js
  14. 3.7.5Boot.js
  15. 3.7.6Preload.js
  16. 3.7.7Splash.js or Language.js
  17. 3.7.8Menu.js
  18. 3.7.9Play.js
  19. 3.8Adventures & Mazes Core Mechanics
  20. 3.8.1Story Plot Generation
  21. 3.8.2Story Generation Tools
  22. 3.8.3Labyrinth Generation Methods
  23. 3.8.4Fixed Generation
  24. 3.8.5Fixed Generation with dynamic content
  25. 3.8.6Pure Linear labyrinths
  26. 3.8.7Rules for Creating the Perfect Maze
  27. 3.8.8Depth-First Search (DFS)
  28. 3.8.9Open-path Worlds
  29. 3.9Conclusion

4Collapsing Blocks Games Mechanics

  1. 4.1Reference From:
  2. 4.2Overview
  3. 4.3Our Goal
  4. 4.4Game Mechanics
  5. 4.5Game Examples
  6. 4.6Game Recipe™ Featured Ingredients
  7. 4.7Starting the Collapsing Blocks project
  8. 4.7.1Step 0: Review your competition and game demonstrations:
  9. 4.7.2Step 1. Create your standard index file.
  10. 4.8Collapsing Blocks Core Game Phases
  11. 4.8.1Step 2. Create Your Standard Game Shell Phases.
  12. 4.8.2Main.js
  13. 4.8.3Boot.js
  14. 4.8.4Preload.js
  15. 4.8.5Splash.js or Language.js
  16. 4.8.6Menu.js
  17. 4.8.7Play.js
  18. 4.9Collapsing Blocks Core Mechanics
  19. 4.9.1Step 3. Create your core game logic & supporting functions.
  20. 4.10Main.js
  21. 4.10.1flood fill function — Line 86 to 106
  22. 4.10.2Refill Game Board — Lines 110 to 128
  23. 4.10.3Insert Blocks — Lines 132 to 150
  24. 4.10.4Fill holes — Lines 153 to 163
  25. 4.10.5Tile selection — Lines 166 to 191
  26. 4.11Game-board set-up
  27. 4.11.1demo.js - Lines 23 to 43:
  28. 4.12Conclusion

5“Connect-4” & “Go” Game Mechanics

  1. 5.1Reference From
  2. 5.2Overview
  3. 5.3Our Goal
  4. 5.4Game Mechanics
  5. 5.4.1Historical background
  6. 5.5Game Examples
  7. 5.6Game Recipe™ Featured Ingredients
  8. 5.6.1Game Genre Components
  9. 5.6.2Rule Variations
  10. 5.7Starting a Connect 4 AI Game Project
  11. 5.7.1Step 0: Review Game demonstrations
  12. 5.7.2Step 1: Create your “front-door”
  13. 5.8Connect 4 AI — Core Game Phases
  14. 5.8.1Step 2. Create Your Standard Game Shell Phases.
  15. 5.8.2Main.js
  16. 5.8.3Boot.js
  17. 5.8.4Preload.js
  18. 5.8.5Splash.js or Language.js
  19. 5.8.6Menu.js
  20. 5.9Design Considerations
  21. 5.9.1Gameboard Development
  22. 5.9.2Game Disc-Tokens
  23. 5.9.32-player and AI-bot
  24. 5.10Connect 4 Game logic & supporting functions
  25. 5.10.1Play.js
  26. 5.11Connect 4+ Core Game Mechanics
  27. 5.11.1Step 3. Create your core game logic & supporting functions
  28. 5.11.2Play.js Deconstruction
  29. 5.11.3Play.create Essential Function - Line 43 to 130
  30. 5.11.4Play.selectCol() - Lines 144 to 191
  31. 5.11.5HUD Mouse functions
  32. 5.11.6Validate “4-in-a-row” Winning Conditions
  33. 5.11.7Declaring a Winner
  34. 5.12Anticipation of Change - Play.js version 2
  35. 5.12.1Other problems for your bespoke solution?
  36. 5.13Doing the AI-thing!
  37. 5.13.1Sample Resources
  38. 5.13.2Deeper Dive: A.I. in Connect4 & Go
  39. 5.13.3Conversion Process
  40. 5.14Conclusion

6Dress-Up Game Mechanics

  1. 6.1Reference From:
  2. 6.2Overview
  3. 6.3Our Goal
  4. 6.4Game Mechanics
  5. 6.5Game Logic and Construction Considerations
  6. 6.5.1Step #1 Find the avatar(s).
  7. 6.5.2Step #2 Create the wardrobe
  8. 6.5.3Step #3 Messy or tidy?
  9. 6.5.4Step #4 Layout Arrangement
  10. 6.5.5Step #5 Asset Download Considerations
  11. 6.6Game Examples
  12. 6.7Current Demand for Dress-UP Games
  13. 6.8Game Recipe™ Featured Ingredients
  14. 6.9Starting the Dress-Up project
  15. 6.9.1Step 0: Review game demonstrations:
  16. 6.9.2Step 1. Create your standard index file.
  17. 6.10Dress-UP Core Game Phases
  18. 6.10.1Step 2. Create your standard game shell scenes.
  19. 6.10.2Main.js
  20. 6.10.3Boot.js
  21. 6.10.4Preload.js
  22. 6.10.5Splash.js or Language.js
  23. 6.10.6Menu.js
  24. 6.10.7Play.js — Overview
  25. 6.11Dog.js – a gentle introduction to standard Dress-UP games
  26. 6.11.1Dog.js Create function – Lines 51 to 130
  27. 6.11.2Dog.js Create function – Lines 131 to 170
  28. 6.12Mark.js – adding clothes and toggles
  29. 6.13Miyoko.js – adding data structures and multiple spritesheets management
  30. 6.13.1Managing Hair and “split-ends”
  31. 6.13.2What’s a Girl to Wear? Clothes management
  32. 6.14Zoe.js – the full Monty
  33. 6.15Common Menu HUD
  34. 6.16Printing
  35. 6.17Saving
  36. 6.18Camera snap-shots
  37. 6.19Conclusion

7Hidden Objects Game Mechanics

  1. 7.1Reference From
  2. 7.2Overview
  3. 7.3Our Goal
  4. 7.4Game Mechanics
  5. 7.4.1Historical background
  6. 7.4.2General Construction Advice?
  7. 7.4.3Deeper Dive: Replayability
  8. Opinion: Expanding The “Replay Value” Of Games
  9. 7.5Game Examples
  10. 7.6Game Recipe™ Featured Ingredients
  11. 7.7Starting a “Hidden Objects” Project
  12. 7.7.1Step 0: Review your competition and game demonstrations:
  13. 7.7.2Step 1: Create your “front-door”
  14. 7.8Hidden Objects Core Game Phases
  15. 7.8.1Step 2: Create your standard game shell scenes
  16. 7.8.2Main.js
  17. 7.8.3Boot.js
  18. 7.8.4Preload.js
  19. 7.8.5Splash.js or Language.js
  20. 7.8.6Menu.js
  21. 7.8.7Play.js
  22. 7.9Creation Methods for Hidden Objects Games
  23. 7.9.1Step 3. Create your core game logic & supporting functions
  24. 7.10Method #1: HTML5 Conversion into Phaser Framework.
  25. 7.10.1Step 1: Project Preparation
  26. 7.10.2Step 2: Project Refactoring
  27. 7.10.3Step 3: Project Plan
  28. 7.10.4Deeper Dive: Better Location Selections
  29. 7.10.5Deeper Dive: Making Phaser v2.x.x Graphics “clickable”
  30. 7.11Method #2: ActionScript into Phaser Framework.
  31. 7.11.1D.R.Y. Speed Limit - 5 GPH (Games Per Hour)!
  32. 7.11.2Cashing In with Hidden Object Games
  33. 7.12Method #3: Winx Quests.
  34. Winx Quests Concert Disaster Deployment
  35. Product History:
  36. Market Saturation: (as of 20150501)
  37. 7.12.1Flash Demo
  38. Game Features:
  39. 7.13Method #3 for Adults: “Find My Flaws”
  40. 7.13.1Flash Demos
  41. 7.13.2Microsoft Office to the Rescue!
  42. 7.14Method #5 - “Find the Difference” Construction
  43. 7.14.1Why not do what others are doing?
  44. 7.14.2Step 1: Project Preparation
  45. 7.14.3Deeper Dive: Project Preparations
  46. 7.14.4Step 2: Create your standard game shell scenes
  47. 7.14.5Step 3: Project Plan & flowchart
  48. 7.14.6Phaser v2.x.x Resources
  49. 7.15Conclusion

8“Jump to Capture” Games Mechanics

  1. 8.1Reference From:
  2. 8.2Overview
  3. 8.3Our Goal
  4. 8.4Game Mechanics
  5. 8.5Game Logic and Rules
  6. 8.6Game Data structure
  7. 8.7Game Examples
  8. 8.8Game Recipe™ Featured Ingredients
  9. 8.9Starting the game project
  10. 8.9.1Step 0: Review game demonstrations
  11. 8.9.2Step 1. Create your standard index file.
  12. 8.10Peg Solitaire Core Game Phases
  13. 8.10.1Step 2. Create your standard game shell scenes.
  14. 8.10.2Main.js
  15. 8.10.3Boot.js
  16. 8.10.4Preload.js
  17. 8.10.5Splash.js or Language.js
  18. 8.10.6Menu.js
  19. 8.10.7Play.js
  20. 8.11Peg Solitaire Core Mechanics
  21. 8.11.1Step 3. Create your core game logic & supporting functions.
  22. 8.11.2Overview
  23. 8.11.3Game Data structures — Lines 26 to 30
  24. 8.11.4hole selected — Lines 332 to 340
  25. 8.11.5peg selected — Lines 341 to 348
  26. 8.11.6validateMove — Lines 358 to 613
  27. 8.12Conclusion

9MahJong Game Mechanics

  1. 9.1References From:
  2. 9.2Overview
  3. 9.3The Goal
  4. 9.4MahJong Game Mechanics & Historical background
  5. 9.5MahJong - “Matching Open Pairs”
  6. 9.5.1General Game Procedures
  7. 9.5.2MahJong Rule Variations
  8. 9.5.3“52 Card Pick-up”
  9. 9.6Game Recipe™ Featured Ingredients
  10. 9.7Starting a MahJong Game Project
  11. 9.7.1Step 0: Review Game demonstrations
  12. 9.7.2Game Competitor Examples
  13. 9.7.3Step 1: Create your “front-door”
  14. 9.8MahJong — Core Game Phases
  15. 9.8.1step 2: Create your standard game shell scenes
  16. 9.8.2Main.js
  17. 9.8.3Boot.js
  18. 9.8.4Preload.js
  19. 9.8.5Splash.js or Language.js
  20. 9.8.6Menu.js
  21. 9.9MahJong Game logic & supporting functions
  22. 9.9.1Play.js
  23. 9.10MahJong Core Game Mechanics
  24. 9.11Step 3. Create game logic & supporting functions
  25. 9.11.1Booting and Loading
  26. 9.11.2Main.js
  27. 9.11.3Defining Tile Metadata
  28. 9.12Play.js
  29. 9.12.1Shuffling & Randomized Deployment
  30. 9.12.2Creating Tiles
  31. 9.12.3Selecting Tiles
  32. 9.12.4Tile Selection & Validation
  33. 9.133D Layout Prototype

10Match-3 Game Mechanics

  1. 10.1References From:
  2. 10.2Overview
  3. 10.3Our Goal
  4. 10.4Game Mechanics
  5. 10.5Game Examples
  6. 10.6Game Recipe™ Featured Ingredients
  7. 10.7Starting the Match-3 project
  8. 10.7.1Step 0: Review game demonstrations
  9. 10.7.2Step 1. Create your standard index file.
  10. 10.8Match-3+ Core Game Phases
  11. 10.8.1Step 2. Create Your Standard Game Shell Phases.
  12. 10.8.2Main.js (or Game.js)
  13. 10.8.3Boot.js
  14. 10.8.4Preload.js
  15. 10.8.5Splash.js or Language.js
  16. 10.8.6Menu.js
  17. 10.8.7Play.js
  18. 10.9Match-3+ Core Mechanics
  19. 10.9.1Step 3. Create your core Game logic & supporting functions
  20. 10.10Game-board set-up
  21. 10.10.1function drawField - Lines 57 to 80:
  22. 10.11Input Validation
  23. 10.11.1Function Tile selection – Lines 81 to 121
  24. 10.11.2Function Tile De-selection – Lines 122 to 129
  25. 10.11.3Function Tile Move – Lines 130 to 161
  26. 10.11.4Function Tile swapping – Lines 162 to 202
  27. 10.11.5Function Tile Next – Lines 199 to 202
  28. 10.11.6Function Tile the same – Lines 203 to 206
  29. 10.11.7Function Tile at – Lines 207 to 214
  30. 10.12Tile Discovery
  31. 10.12.1Function Get Tile row – Lines 215 to 218
  32. 10.12.2Function Get Tile column – Lines 220 to 224
  33. 10.13Game Rules and logic
  34. 10.13.1Function Tile Horizontal Match – Lines 225 to 228
  35. 10.13.2Function Tile Vertical match – Lines 229 to 232
  36. 10.13.3Function Tile is a Match – Lines 233 to 236
  37. 10.13.4Function Existing Match in Board – Lines 237 to 248
  38. 10.13.5Function Match Handling “Workhorse” – Lines 249 to 271
  39. 10.13.6Function Handle Vertical Matches – a delegation pattern; Line 272 to313
  40. 10.13.7Function Handle Horizontal Matches – a delegation pattern; Line 314 to 355
  41. 10.14Game Board Management
  42. 10.14.1Function Tile Removal – Lines 356 to 382
  43. 10.14.2Function Tile Falling (visual display management) – Lines 383 to 427
  44. 10.14.3Function Replenish Tile Field (visual display management) – Lines 428 to 474
  45. 10.14.4Function Tile Holes Below (visual display management) – Lines 475 to 486
  46. 10.14.5Function Tile Holes in Columns (visual display management) – Lines 487 to 497
  47. 10.15Match 3 (Placed) - Tic-tac-toe
  48. 10.16Match 4 (Placed) - “Connect”
  49. 10.17Match 5 (Placed) - “Go”
  50. 10.18Match 3+ - “Tracing-a-line”
  51. 10.19Conclusion

11Memory Match Game Mechanics

  1. 11.1References From:
  2. 11.2Overview
  3. 11.3Our Goal
  4. 11.4Memory Match Game Mechanics
  5. 11.5Game Examples
  6. 11.5.1Memory Match
  7. 11.6Game Recipe™ Featured Ingredients
  8. 11.7Starting Memory Match project
  9. 11.7.1Step 0: Review your competition and game demonstrations:
  10. 11.7.2Step 1. Create your “front-door” index file.
  11. 11.8Memory Match (Pairs) Core Game Phases
  12. 11.8.1Step 2. Create Your Standard Game Shell Phases.
  13. 11.8.2Main.js
  14. 11.8.3Boot.js
  15. 11.8.4Preload.js
  16. 11.8.5Splash.js or Language.js
  17. 11.8.6Menu.js
  18. 11.8.7Play.js
  19. 11.9Memory Pairs Match game logic & supporting functions
  20. 11.10Memory Match (Sequence) game logic & supporting functions
  21. 11.10.1Main.js
  22. 11.10.2Boot.js
  23. 11.10.3PreLoad.js
  24. 11.10.4Credit.js
  25. 11.10.5Menu.js
  26. 11.11Memory Match sequence game logic & supporting functions
  27. 11.11.1Play.js — Overview
  28. 11.11.2Play.js – Lines 36 to 203 Create Function:
  29. 11.11.3Play.js – Lines 205 to 224 Update function
  30. 11.11.4Play.js – Lines 230 to 400 supporting Functions
  31. 11.11.5Play.js – Lines 240 to 243 deselectBox function
  32. 11.11.6Play.js – Lines 244 to 306 playBoxes function
  33. 11.11.7Play.js – Lines 307 to 324 restart function
  34. 11.11.8Play.js – Lines 325 to 360 selectBoxes function
  35. 11.11.9Play.js – Lines 361 to 382 startCountDown function
  36. 11.12Conclusion

12Music & Rhythm Games Mechanics

  1. 12.1Overview
  2. 12.2Our Goal
  3. 12.3Game Mechanics
  4. 12.4Game Examples
  5. 12.5Game Recipe™ Featured Ingredients
  6. 12.6Starting a Music & Rhythm Game Project
  7. 12.6.1step 0: Review Game demonstrations
  8. 12.6.2step 1: Create your “front-door”
  9. 12.7Music & Rhythm — Core Game Phases
  10. 12.7.1Step 2. Create Your Standard Game Shell Phases.
  11. 12.7.2Main.js
  12. 12.7.3Boot.js
  13. 12.7.4Preload.js
  14. 12.7.5Splash.js or Language.js
  15. 12.7.6Menu.js
  16. 12.8Play.js - Overview
  17. 12.9Phaser Essential Functions
  18. 12.9.1Play.js — Management variables — Lines 1 to 80
  19. 12.9.2Play.js — preload — Lines 91 to 95
  20. 12.9.3Play.js — create — Lines 96 to 454
  21. “Callbacks and Events” (Reminder!)
  22. 12.9.4Play.js — Internal Supporting Functions
  23. 12.10Optional v2 Code Design — External Functions
  24. 12.10.1Game Mechanisms as Functions

13Puzzle Game Mechanics

  1. 13.1References From:
  2. 13.2Overview
  3. 13.3Our Goal
  4. 13.4Game Mechanics
  5. 13.4.1Background History
  6. 13.5Game Examples
  7. 13.6Current Demand for Puzzle Games
  8. 13.7Game Recipe™ Featured Ingredients
  9. 13.8Starting a Puzzle project
  10. 13.8.1Step 0: Review demonstration games:
  11. 13.8.2Step 1. Create your “front-door” index file.
  12. 13.9Jigsaw & Slider Puzzle — Core Game Phases
  13. 13.9.1step 2. Create your standard game scenes.
  14. 13.9.2Main.js
  15. 13.9.3Boot.js
  16. 13.9.4Preload.js
  17. 13.9.5Splash.js or Language.js
  18. 13.9.6Menu.js
  19. 13.9.7Play.js
  20. 13.10Slider Puzzle Mechanics & supporting functions
  21. 13.10.1Step 3. Create your core game logic & supporting functions.
  22. 13.10.2Slider Puzzle Code Review:
  23. 13.11Jigsaw Puzzle Mechanics & supporting functions
  24. 13.11.1Step 3. Create your core game logic & supporting functions.
  25. 13.12Jigsaw Game Components
  26. 13.12.1Creating Image Shards
  27. 13.12.2Cropping the pieces
  28. 13.12.3Bezier Curves
  29. 13.13New Jigsaw Design Consideration
  30. 13.14Jigsaw Puzzle Code Review:
  31. 13.14.1Jigsaw Work-Horse: Puzzle.js
  32. 13.14.2Jigsaw Work-Horse: Puzzle_Piece.js
  33. 13.15Plugins
  34. 13.16Conclusion

14Trivia Quiz & Dating Games Mechanics

  1. 14.1References From:
  2. 14.2Overview
  3. 14.3Our Goal
  4. 14.4Game Mechanics
  5. 14.5Game Examples
  6. 14.6Game Recipe™ Featured Ingredients
  7. 14.7Starting a Quiz & Trivia Project
  8. 14.7.1Step 0: Review demonstration games:
  9. 14.7.2Step 1. Create your standard index file.
  10. 14.8Quizzing Core Game Phases
  11. 14.8.1Step 2. Create Your Standard Game Shell Phases.
  12. 14.8.2Main.js (or Game.js)
  13. 14.8.3Boot.js
  14. 14.8.4Preload.js
  15. 14.8.5Splash.js or Language.js
  16. 14.8.6Menu.js
  17. 14.8.7Sample CMS Phaser page — Credits.js
  18. 14.8.8Play.js
  19. 14.93 Quiz & Trivia games logic & supporting functions
  20. 14.10Game #1 — Mensa Mental Math™ — a math tutor game.
  21. 14.10.1Design Notes:
  22. 14.10.2Code Review:
  23. 14.10.3preload function – Lines 138 to 162
  24. 14.10.4create function – Lines 163 to 233
  25. 14.10.5update function – Lines 234 to 281
  26. 14.11Game #1 supporting Functions
  27. 14.11.1answeredQ function – Lines 282 to 299
  28. 14.11.2btnOver function – Lines 300 to 327
  29. 14.11.3checkAnswer function – Lines 330 to 351
  30. 14.11.4gameOver function – Lines 352 to 362
  31. 14.11.5nextQuestion function – Lines 363 to 395
  32. 14.12Game #2 — Tomfoolery Trivia Topics™ — a simple trivia game.
  33. 14.12.1Design Notes:
  34. 14.12.2Database Construction Tools
  35. 14.12.3Remote Question Pool Using AppML
  36. 14.12.4Building an AppML application
  37. 14.12.5Remote Question Pool Using JSON
  38. 14.12.6Creating various Languages
  39. 14.13Game #2 Code Review
  40. 14.13.1Init function — Lines 90 to 115
  41. 14.13.2preload function — Lines 116 to 120
  42. 14.13.3create function — Lines 121 to 193
  43. 14.13.4update function — Lines 194 to 241
  44. 14.14Game #2 supporting Functions
  45. 14.14.1answeredQ function — Lines 242 to 259
  46. 14.14.2btnOver function — Lines 260 to 287
  47. 14.14.3checkAnswer function — Lines 288 to 311
  48. 14.14.4gameOver function — Lines 312 to 318
  49. 14.14.5nextQuestion function – Lines 319 to 352
  50. 14.15Game #3 — Dating Veronica Darlene™ — a simple dating game.
  51. 14.15.1Design Notes:
  52. 14.15.2New conversation dialog format
  53. 14.15.3Conversation Dialog sequence
  54. 14.15.4Creating various Languages
  55. 14.15.5Game #3 updated question format
  56. 14.15.6Game #3 JSON format skeleton
  57. 14.15.7Game Pool Technology
  58. 14.15.8Art Resources
  59. 14.15.9Facial Expressions
  60. 14.16Game #3 Code Review
  61. 14.16.1Init function — Lines 100 to 254
  62. 14.16.2preload function — Lines 255 to 282
  63. 14.16.3create function — Lines 285 to 421
  64. 14.16.4update function — Lines 422 to 467
  65. 14.17Game #3 supporting Functions
  66. 14.17.1checkAnswer function — Lines 516 to 544
  67. 14.17.2clickContinue function — Lines 546 to 746
  68. 14.17.3gameOver function — Lines 749 to 753
  69. 14.17.4nextQuestion function — Lines 756 to 788
  70. 14.18Plugins
  71. 14.19Conclusion

15Role-Playing Game Mechanics (Draft)

  1. 15.1Our Goal
  2. 15.2Game Mechanics
  3. 15.3Game Components & Design Considerations
  4. 15.4Avatar’s Customized Creation
  5. 15.5Other Components
  6. 15.6Game Recipe™ Featured Ingredients
  7. 15.7Starting a RPG Game Project
  8. 15.7.1Step 0: Review your competition and game demonstrations:
  9. 15.7.2Game Examples
  10. 15.7.3Step 1: Create your “front-door”
  11. 15.8RPG — Core Game Phases
  12. 15.8.1Step 2. Create Your Standard “Game Shell” Phases.
  13. 15.9Step 3. Create your RPG Core Mechanics
  14. 15.9.1RPG Story “Chapter 1 of 3”
  15. 15.9.2Demo.js — Stage 1 Development
  16. 15.10Play.js — Stage 2 Overview
  17. Excerpt Phaser Game Prototyping (6th Edition).
  18. References from Mozilla Developers:
  19. 15.10.1Environment Maps
  20. 15.10.2Deeper Dive: Hexagonal Grids
  21. Red Blob games
  22. 15.10.3Separation of Concerns (SoC)
  23. 15.10.4Rogue Prince Starting Position
  24. 15.10.5Deeper Dive: Callbacks & Events
  25. “Callbacks and Events”
  26. 15.11HUD Panels as Scenes
  27. 15.11.1The Game Settings & Options HUD
  28. 15.11.2“Rogue Prince” HUD Panel
  29. 15.11.3Settlements HUD Panel
  30. 15.11.4“Non-Player Character” (NPC) Garrison HUD Panel
  31. 15.11.5Quest & Adventure Records
  32. 15.11.6Privileged Access to Bonus Content
  33. 15.11.7Conflict Resolution System
  34. 15.12Selling RPG Comics
  35. 15.13Quest Editors
  36. 15.13.1Game Development Tools & Generators
  37. 15.143D & 1st person games
  38. 15.14.1Deeper Dive: gITF™ Asset Generations
  39. 15.15Conclusion

16Strategy Game Mechanics

  1. 16.1Overview
  2. 16.2Core “Strategy” Game Construction
  3. 16.3The Goal
  4. 16.4Game Mechanics
  5. Digital Strategy Games Are Broken!
  6. 16.4.1Historical background
  7. 16.4.2Strategy Game Characteristics
  8. Advantages and Disadvantages of Decision Trees
  9. Disadvantages of decision trees:
  10. 16.4.3Types of Strategy Games
  11. 16.4.4Game Mechanics (GM): Logic & Rules
  12. 16.4.5Game Mechanics (GM): Data Structures
  13. 16.5Design Considerations
  14. 16.5.1Deeper Dive: Putting Stories in the Wrong Place
  15. Seven Deadly Sins of strategy game design
  16. 16.5.2Pre-Battle Preparations
  17. 16.5.3Terrain and Unit Symbols
  18. Historical Military Symbols Usage
  19. 16.5.4Battle Narratives
  20. 16.5.5Deeper Dive: Multi-Player versions
  21. 16.5.6Following the herd? - Using expected “Convention”
  22. 16.6Game Examples
  23. 16.7Game Recipe™ Featured Ingredients
  24. 16.8Starting a Strategy Game Project
  25. 16.8.1Step 0: Review Game demonstrations
  26. 16.8.2Step 1: Create your “front-door”
  27. 16.9Strategy — Core Game Phases
  28. 16.10“p2a” Main.js: Stages 1 & 2 consolidated
  29. 16.11“p2a” Boot.js & Load.js: Stages 1 & 2 consolidated
  30. 16.11.1Cross-Origin Requests
  31. 16.12“p2a” story.js: Stages 1 & 2 consolidated
  32. 16.13“p2a” menu.js: Stages 1 & 2 consolidated
  33. When to use “switch” versus “if-else” statements.
  34. 16.14“p2a” demo.js: Tutorial Game
  35. 16.14.1“p2a” demo.js Overview
  36. 16.15“p2a Battle Plans” with sprinkles
  37. 16.15.1“p2a” play.js Overview
  38. 16.15.2“p2a” play.js Battle Plan UI
  39. 16.15.3“p2a” play.js Drop Zones
  40. 16.15.4“p2a” play.js “btnOver” function
  41. 16.15.5“p2a” play.js “doUnitDrop” function
  42. 16.15.6“p2a” play.js “doAssignReset” function
  43. 16.16“p2a Pre-Battle Intelligence” with sprinkles
  44. 16.17“p2a Conduct the Battle” with sprinkles

17Tower Defenses Mechanics

  1. 17.1Game Project Overview
  2. 17.2Our Goal
  3. 17.3Game Recipe™ Featured Ingredients
  4. 17.4Historical background
  5. Com2US listed on KOSDAQ
  6. 17.4.1Game Examples
  7. 17.5Game Mechanics (GM) - Logic & Rules
  8. 17.5.1Feature Recommendations
  9. 17.6Game Mechanics (GM) - Data Structure
  10. 17.6.1Game Framework Mechanisms Elements
  11. 17.7Game Recipe™ Featured Ingredients
  12. 17.8Design Considerations
  13. 17.8.1Gameboard Development
  14. Phaser PathFollowers
  15. 17.8.2Deeper Dive: Path Follower Resources
  16. 17.9TD Game Modes
  17. 17.10Conclusion: “What vs. How”
  18. 17.11Game #1: “p2a” prototype
  19. 17.12Initial Project files (Phaser v2.0.6):
  20. 17.13Step #1: Front Door Analysis
  21. Change Summary of the original files:
  22. 17.14“p2a” Game Mechanics (GM) Overview
  23. 17.14.1GM: main.js
  24. 17.15Step #2: Game Shell & Game Phases
  25. 17.15.1Boot.js Modifications
  26. 17.15.2Menu.js prototype (No Modifications)
  27. 17.16Step #3 Game Framework Mechanisms (GFM) Overview
  28. 17.17Step #4: Supporting Functions: Lines 217 to 557
  29. 17.17.1btnOut: Lines 226 to 257
  30. 17.17.2btnOver: Lines 259 to 310
  31. 17.17.3vpFSM: Lines 312 to 343
  32. 17.17.4doUpgradeReturn: Lines 344 TO 417
  33. 17.17.5doAssignReset: Lines 418 to 518
  34. 17.17.6doSelect: Lines 518 to 553
  35. 17.18Game #1 Stage 2: “Beta” Pre-release
  36. 17.19Conclusion
  37. IIIPart III - ActionScript (ES4) into JS

18Transpiling AS2 or AS3 into JS

  1. 18.1Introduction and official statements
  2. Differences between ActionScript and JavaScript
  3. 18.2Flash Platform Basics
  4. 18.3HTML5 Platform Basics
  5. Quote from Phaser Game Design Workbook
  6. 18.4Difference between JS and AS
  7. 18.5Converting from Flash ActionScript to JavaScript
  8. 18.5.1Conversion Tools
  9. 18.6Why TypeScript? Phaser 4 coming!
  10. A language of its own vs. a JavaScript super-set

19AS3 to JavaScript

  1. 19.1References:
  2. 19.2Language similarities
  3. Richard Davey AS3 to Typescript
  4. 19.3Getting Started
  5. 19.4Tools
  6. 19.5Conversion Practicum

20AS2 to JavaScript

  1. 20.1References:

21322+ AS Games Available for Conversion!

  1. 21.1Reference:
  2. 21.2Some important notes:
  3. 21.3Questions and Answers
  4. 21.3.1AS2
  5. 21.3.2AS3
  6. 21.4Flash Game University — 36+ games!
  7. 21.5About GameScene
  8. 21.6MacroMedia 150+ Flash Game Collection
  9. 21.7Stephen Gose Game Studio (SGGS) - 127+ more!
  10. 21.81,746+ Games from the “Internet Arcade”
  11. IVPart IV - MMOG (Excerpt)

22Hot-seat MMoG?

  1. 22.1Network Foundation Inventory
  2. 22.2Deeper Dive: Testing MMoGs Locally??
  3. 22.3Hot-seat MMoG Demos

232-Player Remote Games

  1. 23.1MMoG engine Criteria:

24Massive Multi-Player Games

  1. 24.1MMoG Application Architecture
  2. 24.2Comparing Single- to Multi-Player Games
  3. 24.2.1Deeper Dive: Using Web Workers
  4. 24.2.2Deeper Dive: Await and Promises
  5. 24.3Differences in MMoG Games?
  6. Web MVC - Web Application Programming

25MMoG Hosting Options

  1. 25.1Server-side Research
  2. VSimulations & “A.I.” Mechanics

26Foreign Exchange, Bit-Coin & Commodities Trading

  1. 26.1Reference and Excerpts From
  2. 26.2Overview
  3. 26.3Our Goal
  4. 26.4Simulation Mechanics
  5. 26.5Simulation Game Examples
  6. 26.6Simulation Charting

27“Vo4X Shepherd Shell”™

  1. 27.1“Vo4X Shepherd Shell”™ Construction
  2. 27.2Cashing In with Your Expert Advisor(s)
  3. How to Earn from MQL5.community
  4. 27.3EA Protection
  5. 27.4VoFX Collection
  6. 27.5Chapter Summary
  7. Appendix

More Resources

  1. JavaScript Garden
  2. Additional Appendices
  3. Other resources:
  4. Selling your Game Assets

Appendix: Online Game Development

Appendix: Making WebXR Games!

Appendix: Phaser III Plugins

Appendix: “How to Start a WebSocket”

  1. Testing Your Browser
  2. Test sites:
  3. WebSocket Protocol Handshake
  4. Deeper Dive: WebSocket API
  5. Sample Source Code: Client-side WebSocket
  6. Step #1: Game index page
  7. Step #2: Generate Event handlers

Appendix: OLOO - Safe JavaScript

  1. JS Objects: “TL;DR”
  2. 15.2.2 Inside the body of a class definition
  3. Deeper Dive: JS Delegation (aka “Inheritance”?)
  4. The old way
  5. “Object Oriented JavaScript Pattern Comparison”
  6. ECMA-262 7th Edition / June 2016
  7. Objects Linking to Other Objects (OLOO)
  8. Compare your code
  9. Object.create
  10. Exercise Lesson 9:
  11. Exercise 1
  12. Game Singletons
  13. Deeper Dive: Object Manipulation objects in ES5/6
  14. Lesson Summary
  15. Resource References:

Contributor

About the Contributors

Richard Davey

The Leanpub 60 Day 100% Happiness Guarantee

Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

Now, this is technically risky for us, since you'll have the book or course files either way. But we're so confident in our products and services, and in our authors and readers, that we're happy to offer a full money back guarantee for everything we sell.

You can only find out how good something is by trying it, and because of our 100% money back guarantee there's literally no risk to do so!

So, there's no reason not to click the Add to Cart button, is there?

See full terms...

Earn $8 on a $10 Purchase, and $16 on a $20 Purchase

We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.

(Yes, some authors have already earned much more than that on Leanpub.)

In fact, authors have earned over $14 million writing, publishing and selling on Leanpub.

Learn more about writing on Leanpub

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!

Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.

Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.

Learn more about writing on Leanpub