Created
March 5, 2019 11:13
-
-
Save EliteIntegrity/824274b79fffd288c7545b4277605cd8 to your computer and use it in GitHub Desktop.
This code draws all the bullets for the player and the invaders. Add the code after the code which draws the shelters/bricks, as shown.
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
... | |
... | |
// Draw the bricks if visible | |
for (brick in bricks) { | |
if (brick.isVisible) { | |
canvas.drawRect(brick.position, paint) | |
} | |
} | |
// Draw the players playerBullet if active | |
if (playerBullet.isActive) { | |
canvas.drawRect(playerBullet.position, paint) | |
} | |
// Draw the invaders bullets | |
for (bullet in invadersBullets) { | |
if (bullet.isActive) { | |
canvas.drawRect(bullet.position, paint) | |
} | |
} | |
// Draw the score and remaining lives | |
... | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment