BUILD PACMAN
BUILD PACMAN
Learn Modern Javascript, HTML5 Canvas, and a bit of EmberJS
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.
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?
- Notes
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 earnedover $14 millionwriting, 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