Remove weaponsSystem.h and added Events

main
Jerry Aldrich 11 years ago
parent bec35897c7
commit 676bf86e38
  1. 5
      events.c
  2. 6
      events.h
  3. 2
      gameLoop.c
  4. 1
      initializeWorld.c
  5. 1
      structs.h
  6. 9
      weaponsSystem.h
  7. 3
      world.h

@ -0,0 +1,5 @@
#include <events.h>
void addItem(){
}

@ -0,0 +1,6 @@
#ifndef _EVENTS
#define _EVENTS
void addItem();
#endif

@ -1,6 +1,7 @@
#include <world.h> #include <world.h>
#include <screen.h> #include <screen.h>
#include <collisionDetection.h> #include <collisionDetection.h>
#include <events.h>
void gameLoop(){ void gameLoop(){
int lastPressed; int lastPressed;
@ -9,6 +10,7 @@ void gameLoop(){
drawViewport(); drawViewport();
moveProjectiles(); moveProjectiles();
moveZombies(); moveZombies();
addItem();
doupdate(); doupdate();
int ch; int ch;

@ -7,6 +7,7 @@
void initializeWorld() { void initializeWorld() {
struct Entity player = {.type="player",.symbol='@', .curYpos=1, .curXpos=1, .nextYpos=1, .nextXpos=1 ,.isAlive=1}; 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 Weapon pistol = {.name="Pistol", .range=3, .maxCapacity=12, .curCapacity=12, .symbols="-\\|/-\\|/"};
struct Item pistolMag = {.name="Pistol Magazine", .symbol='=', .isAlive=0 };
srand(time(NULL)); srand(time(NULL));
initscr(); initscr();

@ -6,6 +6,7 @@ struct Weapon{
int range; int range;
int maxCapacity; int maxCapacity;
int curCapacity; int curCapacity;
int curMags;
char projectileSymbol; char projectileSymbol;
char symbols[8]; char symbols[8];
}; };

@ -1,9 +0,0 @@
#ifndef _WEAPONS_SYSTEM
#define _WEAPONS_SYSTEM
#include <structs.h>
#define MAX_PROJECTILES 2
struct Projectile projectiles[MAX_PROJECTILES];
#endif

@ -8,8 +8,9 @@
struct Entity allEntities[MAX_ALIVE]; struct Entity allEntities[MAX_ALIVE];
#define MAX_PROJECTILES 2
struct Projectile projectiles[MAX_PROJECTILES];
#define INITIAL_SPAWN_NUM 10 #define INITIAL_SPAWN_NUM 10
void initializeWorld();
#endif #endif

Loading…
Cancel
Save