Skip to content

Instantly share code, notes, and snippets.

@EliteIntegrity
Created March 5, 2019 09:42
Show Gist options
  • Save EliteIntegrity/51588208d37d4f65e180fc963d06b62d to your computer and use it in GitHub Desktop.
Save EliteIntegrity/51588208d37d4f65e180fc963d06b62d to your computer and use it in GitHub Desktop.
Initialize all the Invader instances in the prepareLevel function
private fun prepareLevel() {
// Here we will initialize the game objects
// Build an army of invaders
Invader.numberOfInvaders = 0
numInvaders = 0
for (column in 0..10) {
for (row in 0..5) {
invaders.add(Invader(context,
row,
column,
size.x,
size.y))
numInvaders++
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment