parent
676bf86e38
commit
d0ed16db04
10 changed files with 35 additions and 16 deletions
@ -1,5 +1,15 @@ |
|||||||
#include <events.h> |
#include <events.h> |
||||||
|
#include <structs.h> |
||||||
void addItem(){ |
#include <world.h> |
||||||
|
void addItem(char *name, int yPos, int xPos){ |
||||||
|
if(!strcmp(name,"Pistol Magazine")){ |
||||||
|
struct Item pistolMag = {.name="Pistol Magazine", .symbol='=', .isAlive=1, .curXpos=xPos, .curYpos=yPos}; |
||||||
|
int i; |
||||||
|
for (i=0;i<MAX_ITEMS;i++){ |
||||||
|
if(!allItems[i].isAlive){ |
||||||
|
allItems[i]=pistolMag; |
||||||
|
break; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
} |
} |
||||||
|
@ -1,6 +1,6 @@ |
|||||||
#ifndef _EVENTS |
#ifndef _EVENTS |
||||||
#define _EVENTS |
#define _EVENTS |
||||||
|
|
||||||
void addItem(); |
void addItem(char *name, int yPos, int xPos); |
||||||
|
|
||||||
#endif |
#endif |
||||||
|
Loading…
Reference in new issue