BUILD PACMAN
BUILD PACMAN
BUILD PACMAN

This book is 100% complete

Completed on 2016-10-22

About the Book

This is a book about surviving an alien invasion and using web technologies.

In this book you'll learn the basics of Javascript (including some new ES6+/ES2015+ features), play with HTML5 Canvas, and take advantage of EmberJS and ember-cli.  You'll also train as a PAC operator- ripped from your comfy lab by a special order from the Elders, you must learn quickly in order to help fight off the alien menace.

BUILD PACMAN is meant for users who know at least one other programming language but aren't terribly experienced with Javascript.  However, it's also useful for people who know Javascript but want a gentle introduction to (parts of) EmberJS, people who are curious about new Javascript features or HTML5 Canvas, and people who just want to relax and BUILD PACMAN.

About the Author

Jeffrey Biles
Jeffrey Biles

Jeffrey loves EmberJS, teaching, writing, and making games.  If only there were a way he could satisfy every single one of those in one project...

Anyways, you can catch more of his work at https://www.emberscreencasts.com/, where he's created over 100 videos about EmberJS and Javascript.

You can also contact him at jeffrey@emberscreencasts.com to find out about getting Ember training for your company.  Yes, you should do that.

Table of Contents

  • In Media Res
  • 1: Drawing A circle
    • Installation
    • Creating your app
    • Displaying a box
    • Drawing a circle
    • Setup complete
  • Training
  • 2: Getting up to speed
    • Components
    • Handlebars
    • Canvas
    • Css
    • Canvas context and drawing
    • Let
    • didInsertElement
    • Functions
    • import/export
    • Feeling good yet?
  • Control
  • 3: Input
    • Steal This Code
    • Bringing it in
    • Mixins
    • Defining keyboard shortcuts
    • Hashes
    • Logging
    • Summary
  • Displacement
  • 4: Movement
    • Properties
    • Updating Properties
    • Moving the PAC
    • Clearing the screen
    • Extracting methods
    • A computed property
    • Summary
  • Barriers
  • 5: Enclosure
    • Alignment
    • If statements
    • Fully functional collisions
    • Handlebars Binding
    • Summary
  • The Maze Inside
  • 6: Internal Barriers
    • Drawing a wall
    • Walls, arrayed before us
    • Drawing all the walls
    • Call the Draw
    • Wall Collisions
    • Summary
  • Clearing a Path
  • 7: The Grid
    • Seeing the grid
    • Arrays of arrays
    • Displaying the grid
    • Calculating the level width and height
    • Deep gets
    • Moving through the space
    • Summary
  • First Harvest
  • 8: Pellets
    • Drawing Pellets
    • Say what you do, do what you say
    • Scope Troubles
    • Fat Arrows
    • Share your circle
    • Processing the pellets
    • Summary
  • Gains and Losses
  • 9: Scores and Levels
    • Keeping Score
    • Level Up
    • New Syntax
    • Summary
  • Smooth, Efficient
  • 10: Animations
    • Coordinating Directions
    • nextCoordinate and Interpolated Strings
    • Looking ahead with the Grid
    • Smooth Animations
    • Guarding our movement
    • The Movement Loop
    • Ember.run.later
    • Drawing with FrameCycles
    • Summary
  • No Stopping
  • 11: The Game Loop
    • Rollin rollin rollin
    • The Intent system
    • Summary
  • Objectifying
  • 12: Separation of Concerns
    • Defining new files
    • Return of the ES2015 Modules
    • Classy Systems
    • Mixins
    • Classes and Instances
    • Summary
  • Loyalties
  • 13: Separation of Concerns
    • Separation: Pac Object
    • Separation: SharedStuff Mixin
    • Separation: pac-man Component
    • Separation: Partial method extraction
    • Resyncing on Restart
    • Summary
  • Separation
  • 14: Level Out
    • The Level Object
    • Restarting It All
    • Making it all fit
    • LessSharedStuff
    • Another Level
    • The Level Gains More Regulatory Power
    • Summary
  • First Haunting
  • 15: Ghostly
    • The Ghost Itself
    • True Colors
    • Movement: It’s alive!
    • Heat-seeking Ghosts
    • Map
    • Where’s the Pac?
    • The (Weighted Random) Chase
    • Summary
  • Sacrifice
  • 16: Contact
    • Multiple Ghosts
    • Better Arrow Functions
    • Collision Detection
    • Places, Please
    • Super Spread(optional)
    • Level Knows Best
    • Extra Lives
    • Summary
  • Ruins
  • 17: Moving On Down
    • The Level Array
    • Changing Levels
    • Summary
  • Patrol
  • 18: Teleport
    • Finding What to Change
    • Where Do We Go From Here
    • Turning It On
    • A Teleport-First Level
    • Summary
  • A New Hope
  • 19: Power
    • On The Map
    • Changing Colors, Ternary Operators
    • Resetting the Level
    • Summary
  • The PACs Strike Back
  • 20: Turning the Tide
    • Ghost Run
    • Shorthand Operators
    • More Specific Collisions
    • Full Retreat
    • Regroup
    • Summary
  • The Return of the Jihadi
  • 21: Time’s Up
    • Timers
    • Power Waning
    • A New If
    • Changing Colors
    • RGB
    • Mixing Colors
    • Retreat, Redone
    • Summary
  • Epilogue
  • What’s Next?

The Leanpub 45-day 100% Happiness Guarantee

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

See full terms...

Write and Publish on Leanpub

Authors, publishers and universities use Leanpub to publish amazing in-progress and completed books and courses, just like this one. You can use Leanpub to write, publish and sell your book or course as well! 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. It really is that easy.

Learn more about writing on Leanpub