Last active
June 7, 2017 12:02
-
-
Save snggeng/444df39a9c78bee260dbe88e9c31f387 to your computer and use it in GitHub Desktop.
Spawn enemy in game.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Setup event listeners | |
function setupEvents() { | |
// Add event listeners for different types of events in the game | |
// code omitted for brevity | |
} | |
// Spawn enemy | |
function spawnEnemy(){ | |
var enemy = new Enemy(); | |
assets.push(enemy) | |
} | |
// Startup the game | |
function init(){ | |
setupEvents(); | |
spawnEnemy(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment