Skip to content

Instantly share code, notes, and snippets.

@tgraham777
Forked from stevekinney/gist:353182d7cd10fb4a5b27
Last active December 9, 2015 07:23
Show Gist options
  • Save tgraham777/facfa7b4dd281d5b35ba to your computer and use it in GitHub Desktop.
Save tgraham777/facfa7b4dd281d5b35ba to your computer and use it in GitHub Desktop.

Step One: Watch Mary Rose Cook Live Codes Space Invaders from Front-Trends. (The second worst conference name ever?)

Step Two: Fork this gist.

Step Three: Respond to this question in your fork: What is one approach you can take from this Mary's code and implement in your project?

Ultimately I think the vast majority of Mary's code will have to be changed in order to conform to our TDD-driven structure. Her strategy was no doubt designed for speed, but it lacks the clarity or testability of the TDD-driven approach.

However, there are certain specific functions in her code that could likely be easily imported:

  • using a conditional on keyboarder.isDown to determine if, how fast, and in what direction the center of the player moves
  • using a velocity attribute assigned to the bullet to determine the speed at which the center of the bullet moves
  • the general concept behind using the Keyboarder expression to determine when a key is pressed

Step Four: Totally Optional: take a look at some of the other forks and comment if the spirit moves you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment