Skip to content

Instantly share code, notes, and snippets.

@writingdeveloper
Created November 20, 2017 06:54
Show Gist options
  • Save writingdeveloper/0c834b4ab963e70cca87607c8ee0e8a4 to your computer and use it in GitHub Desktop.
Save writingdeveloper/0c834b4ab963e70cca87607c8ee0e8a4 to your computer and use it in GitHub Desktop.
app.js
// Enemies our player must avoid
var Enemy = function(x, y, speed) {
this.x = x;
this.y = y;
this.speed = speed;
// The sprite continuously crops and displays the image.
this.sprite = 'images/enemy-bug.png';
};
var Enemy_Rock = function(x, y, speed) {
this.x = x;
this.y = y;
this.speed = speed;
// The sprite continuously crops and displays the image.
this.sprite = 'images/Rock.png';
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment