Created
November 20, 2017 12:53
-
-
Save Mikepicker/facedeba0706cccb3bdcb12e363ae1b9 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
const int ZOMBIE_COUNT = 20; | |
const int SPAWN_FREQ = 3; | |
unsigned int lastSpawnTime = 0, currentTime; | |
int zombieAnimSpeed = 8; | |
int zombieSpeed = 3; | |
SDL_Texture* zombieTexture; | |
struct Zombie { | |
float x, y; | |
int w = 64; // Width and height have been moved here for a cleaner code | |
int h = 64; | |
float vX, vY; | |
int dir; | |
int frameX, frameY; | |
bool animCompleted = false; // Is the attack animation completed? | |
bool attack = false; // Has the zombie inflicted damage? | |
bool alive = false; | |
std::string state; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment