Created
November 16, 2017 20:32
-
-
Save Mikepicker/475dfbb2cee648f0dc9d022ed7aebbcd to your computer and use it in GitHub Desktop.
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
void shootBullet() { | |
for (int i = 0; i < BULLET_COUNT; i++) { | |
if (!bullets[i].alive) { | |
if (survivor.scaleX == 1) { | |
bullets[i].x = survivor.x + 48; | |
} else { | |
bullets[i].x = survivor.x + 16; | |
} | |
bullets[i].y = survivor.y + 32; | |
bullets[i].dir = survivor.scaleX; | |
bullets[i].alive = true; | |
return; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment