Created
March 5, 2019 09:42
-
-
Save EliteIntegrity/51588208d37d4f65e180fc963d06b62d to your computer and use it in GitHub Desktop.
Initialize all the Invader instances in the prepareLevel function
This file contains 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
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