Skip to content

Instantly share code, notes, and snippets.

@Mikepicker
Created November 16, 2017 20:32
Show Gist options
  • Save Mikepicker/475dfbb2cee648f0dc9d022ed7aebbcd to your computer and use it in GitHub Desktop.
Save Mikepicker/475dfbb2cee648f0dc9d022ed7aebbcd to your computer and use it in GitHub Desktop.
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