Created
November 20, 2017 14:36
-
-
Save Mikepicker/d3a2d42f4e8ff6189eb028d3f7de5ccc 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
// For each alive bullet.. | |
for (int i = 0; i < BULLET_COUNT; i++) { | |
if (bullets[i].alive) { | |
bullets[i].x += bulletSpeed * bullets[i].dir; | |
// Out of screen -> dead | |
if (bullets[i].x + bullets[i].w < 0 || bullets[i].x > SCREEN_WIDTH) { | |
bullets[i].alive = false; | |
} | |
// Hit zombie | |
hitZombies(&bullets[i]); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment