One of my first programming projects. I tried to learn C and use curses...it is quite embarrassing looking back at it now :D
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

66 lines
1002 B

#ifndef _STRUCTS
#define _STRUCTS
#include <time.h>
struct Weapon{
char *type;
int isAlive;
int projectileRange;
int maxCapacity;
int curCapacity;
int curMags;
char projectileSymbol;
char symbols[8];
float projectileSpeed;
};
struct Item{
char *type;
char symbol;
int isAlive;
int curYpos;
int curXpos;
};
struct Entity {
char *type;
char *behavior;
char symbol;
int prevYpos, prevXpos;
int curYpos, curXpos;
struct Weapon weapons[5];
struct Item items[7];
int curWeapon;
int isAlive;
int hitCount;
int killCount;
int projectilesFired;
clock_t lastMoveClock;
float speed;
};
struct Projectile{
int isAlive;
char symbol;
int curYpos;
int curXpos;
int prevYpos;
int prevXpos;
int nextYpos;
int nextXpos;
int range;
char direction;
int distanceTraveled;
clock_t lastMoveClock;
float speed;
};
struct CollisionEvent{
struct Entity * collidedWithEntity;
struct Item * collidedWithItem;
int collidedWithUnPassableChar;
int collidedWithBoundary;
};
#endif