View on GitHub

JS1 Help

How-To's from Mr. Hinkle's Intro to JavaScript Class

Building a Game

We’re going to get started building our first game.

For this game, we’re going to assume a very simple type of movement: we’ll have an item moving in one dimension (left-right or top-bottom) dodging (or catching?) items that move toward it. Think: a baseball glove catching balls, or a paper airplane dodging rain drops.

Overall, we’ll be taking the following steps:

  1. Setting up our project (background, files, etc)
  2. Creating our “player” object.
  3. Letting the user move the object
  4. Creating MULTIPLE OBJECTS (arrays!) and making them move.
  5. Detecting a collision between our player and our objects.
  6. Adding a scoreboard

I’m going to assume you can get step 1 completed on your own. If you have trouble, take a look at the screensaver project set up, which should be very similar.

Once you have a basic project set up, we’re going to create our player!