diff --git a/events.c b/events.c new file mode 100644 index 0000000..e8a4776 --- /dev/null +++ b/events.c @@ -0,0 +1,5 @@ +#include + +void addItem(){ + +} diff --git a/events.h b/events.h new file mode 100644 index 0000000..ab5a3d8 --- /dev/null +++ b/events.h @@ -0,0 +1,6 @@ +#ifndef _EVENTS +#define _EVENTS + +void addItem(); + +#endif diff --git a/gameLoop.c b/gameLoop.c index e8cbf7b..1f5403a 100644 --- a/gameLoop.c +++ b/gameLoop.c @@ -1,6 +1,7 @@ #include #include #include +#include void gameLoop(){ int lastPressed; @@ -9,6 +10,7 @@ void gameLoop(){ drawViewport(); moveProjectiles(); moveZombies(); + addItem(); doupdate(); int ch; diff --git a/initializeWorld.c b/initializeWorld.c index 5dd85a0..2870882 100644 --- a/initializeWorld.c +++ b/initializeWorld.c @@ -7,7 +7,8 @@ void initializeWorld() { struct Entity player = {.type="player",.symbol='@', .curYpos=1, .curXpos=1, .nextYpos=1, .nextXpos=1 ,.isAlive=1}; struct Weapon pistol = {.name="Pistol", .range=3, .maxCapacity=12, .curCapacity=12, .symbols="-\\|/-\\|/"}; - + struct Item pistolMag = {.name="Pistol Magazine", .symbol='=', .isAlive=0 }; + srand(time(NULL)); initscr(); curs_set(0); diff --git a/structs.h b/structs.h index fdba6c9..8b18015 100644 --- a/structs.h +++ b/structs.h @@ -6,6 +6,7 @@ struct Weapon{ int range; int maxCapacity; int curCapacity; + int curMags; char projectileSymbol; char symbols[8]; }; diff --git a/weaponsSystem.h b/weaponsSystem.h deleted file mode 100644 index 44ebe44..0000000 --- a/weaponsSystem.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef _WEAPONS_SYSTEM -#define _WEAPONS_SYSTEM - -#include - -#define MAX_PROJECTILES 2 -struct Projectile projectiles[MAX_PROJECTILES]; - -#endif diff --git a/world.h b/world.h index aad8082..db7c4d3 100644 --- a/world.h +++ b/world.h @@ -8,8 +8,9 @@ struct Entity allEntities[MAX_ALIVE]; +#define MAX_PROJECTILES 2 +struct Projectile projectiles[MAX_PROJECTILES]; #define INITIAL_SPAWN_NUM 10 -void initializeWorld(); #endif