Dumb-ways-to-memorize
2D game
game.c
Go to the documentation of this file.
1 #include "globals.h"
2 #include "player_controller.h"
3 #include "game.h"
4 #include "entity.h"
5 #include "mystrings.h"
6 #include "parseobject.h"
7 #include "parseentity.h"
8 #include "parsepowerup.h"
9 #include "parselevel.h"
10 #include "dumb_physics.h"
11 #include "player.h"
12 #include "graphics.h"
13 #include <SDL.h>
14 #include <string.h>
15 #include <stdio.h>
16 #include <stdlib.h>
17 #include <string.h>
18 #include "menu.h"
19 
20 //All char ** should be size+1, and ending member = NULL
21 
22 int exitRequest = 0;
23 int gDelay = 0;
26 char **gLevels = NULL;
27 char **gSelectedLevels = NULL;
28 char **gSelectedPowerUps = NULL;
29 char **gUsedPowerUps = NULL;
33 object_t *gGameObject;
34 object_t *gEntityObject;
35 object_t *gLevelObject;
36 char *gGameData;
38 char *gLevelData;
39 char *gEntitiesFile = NULL;
40 char *gPowerUpsFile = NULL;
42 power_t *gPowerUps;
43 char *gCurrentPowerUpName = NULL;
45 sprite_t *gSplash = NULL; /**< The splash screen sprite*/
46 vec2_t gZeroPos = {0,0};
47 SDL_Event gEventQ; /**< The event qeueu update with all SDL_Events */
48 SDL_GameController *gController = NULL;
49 SDL_GameControllerButton gButtonQ;
50 unsigned int gCurrentTime = 0;
51 
52 /**
53  * Loads game data from GameData.json, stored in gGameData.
54  *
55  * @return state 0 on success, -1 on error.
56  *
57  * @author Anthony Rios
58  * @date 1/31/2016
59  */
61 {
62  vec2_t *screen;
63  object_t *temp_obj;
64  //Init GameData Parse
65  if(ConvertFileToUseable(JSON_FILE, &gParser, &gGameData, &gGameTokens) == -1)
66  {
67  printf("Failure to Parse GameData");
68  return -1;
69  }
70 
71  //Debug Checks & Object Parse
72  gGameObject = ParseToObject(gGameTokens, gGameData);
73  if(!gGameObject)
74  {
75  printf("Object parse error");
76  return -1;
77  }
78 
79  //Set Screen Dims
81  if(temp_obj)
82  {
83  screen = ParseToVec2(temp_obj, gGameData);
84  gScreenWidth = screen->x;
85  gScreenHeight = screen->y;
86  printf("New Screen resolution : %d %d \n", gScreenWidth, gScreenHeight);
87  free(screen);
88  }
92 
93  return 0;
94 }
95 
97 {
98  int i, objects;
99  entity_t *temp_ent, *pos_ent;
100 
101  //Init Entity Parse
102  if( ConvertFileToUseable(gEntitiesFile, &gParser, &gEntityData, &gEntityTokens) == -1)
103  {
104  printf("Failure to Parse Entity Data \n");
105  return -1;
106  }
107  gEntityObject = ParseToObject(gEntityTokens, gEntityData);
108  printf("Size of Entity tokens: %d \n", CountMem(gEntityTokens, sizeof(jsmntok_t)));
111 
112  //Set Entity Dictionary
113  objects = CountMem(gEntityObject->children, sizeof(object_t));
114 
115  for(i = 0; i < objects; i++)
116  {
117  //Set sprites for each object
118  if(FindKey(gEntityObject->children[i].keys, "sprite(s)", gEntityData))
119  {
120  temp_ent = ParseToEntity(&gEntityObject->children[i], gEntityData);
121  if(!temp_ent) continue;
122 
123  pos_ent = FindNextFreeCachePos();
124  memcpy(pos_ent, temp_ent, sizeof(entity_t));
125 
126  //if(temp) free(temp);
127  } else if ( FindObject(&gEntityObject->children[i], "sprite(s)") )
128  {
129  temp_ent = ParseToEntity(&gEntityObject->children[i], gEntityData);
130  if(!temp_ent) continue;
131 
132  pos_ent = FindNextFreeCachePos();
133  memcpy(pos_ent, temp_ent, sizeof(entity_t));
134  //if(temp) free(temp);
135  }
136  }
137  return 0;
138 }
139 
140 /**
141  * Loads level file names, and how many levels per game.
142  *
143  * @return The level data.
144  *
145  * @author Anthony Rios
146  * @date 3/29/2016
147  */
149 {
150  object_t *levelObj;
151  int i, lvlInt;
152 
153  //Find Levels
154  levelObj = FindObject(gGameObject, "Levels");
156  if(gLevelsPerGame == -1)
157  {
159  if(!gLevelsPerGame)
161  }
162  if(!levelObj)
163  {
164  printf("No levels found in gameObject");
165  return -1;
166  }
167 
168  //Alloc
169  lvlInt = CountMem(levelObj->values, sizeof(jsmntok_t));
170  gLevels = (char**) malloc(sizeof(char*) * (lvlInt + 1));
171 
172  //Load
173  for(i = 0; i < lvlInt; i++)
174  {
175  gLevels[i] = JsmnToString(&levelObj->values[i], gGameData);
176  if(!gLevels[i])
177  {
178  continue;
179  }
180  printf("Level : %s \n", gLevels[i]);
181  }
182 
183  gLevels[lvlInt] = NULL;
184  return 0;
185 }
186 
187 /**
188  * After Load GameData, Before Menu.
189  * Loads the power_ups in the file given.
190  *
191  * @return The power up data.
192  *
193  * @author Anthony Rios
194  * @date 3/29/2016
195  */
197 {
198  jsmntok_t *power_tok;
199  object_t *powers, *temp_obj;
200  power_t *temp_power;
201  char *power_str;
202  int powerCount, i;
203 
204  temp_obj = FindObject(gGameObject, "PowerUps");
205  if(!temp_obj)
206  {
207  printf("Could not find powerups in GameData");
208  return -1;
209  }
210 
211  gPowerUpsFile = JsmnToString(temp_obj->values, gGameData);
212  ConvertFileToUseable(gPowerUpsFile, NULL, &power_str, &power_tok);
213  if(!power_str || !power_tok)
214  {
215  printf("Could not load power ups file : %s \n", gPowerUpsFile );
216  }
217 
218  powers = ParseToObject(power_tok, power_str);
219  powerCount = CountMem(powers->children, sizeof(object_t));
220  gPowerUps = (power_t*) malloc(sizeof(power_t)*( powerCount+1 ));
221  if(!gPowerUps)
222  {
223  printf("Could not allocate power ups");
224  return -1;
225  }
226 
227  for(i = 0; i < powerCount; i++)
228  {
229  temp_power = ParseToPowerUp(&powers->children[i], power_str);
230  if(!temp_power)
231  {
232  printf("Power up %d could not be loaded \n", i);
233  continue;
234  }
235  gPowerUps[i] = *temp_power;
236  if(temp_power) free(temp_power);
237  }
238  memset(&gPowerUps[powerCount], 0, sizeof(power_t));
239  return 0;
240 }
241 
242 /**
243  * Loads menu data, from files given, which are put in gMenus
244  *
245  * @return The menu data.
246  *
247  * @author Anthony Rios
248  * @date 3/29/2016
249  */
251 {
252  int i, menuCount;
253  char *menuData, *menuLink, *temp_str;
254  jsmntok_t *menuTok;
255  object_t *menus, *menuObj;
256  if(!gMenus)
257  {
258  InitMenuSystem();
259  }
260  menus = FindObject(gGameObject, "Menus");
261  menuCount = CountMem(menus->values, sizeof(jsmntok_t)) - 1;
262  for(i = 0; i < menuCount; i++)
263  {
264  temp_str = JsmnToString(&menus->values[i], gGameData);
265  ConvertFileToUseable(temp_str, NULL, &menuData, &menuTok);
266  if(!menuData || !menuTok)
267  {
268  continue;
269  }
270  menuObj = ParseToObject(menuTok, menuData);
271  if(!menuObj)
272  {
273  free(temp_str);
274  continue;
275  }
276  PrintObject(menuObj, menuData);
277  menuObj->name = temp_str;
278  menuLink = FindValue(menuObj, "link", menuData);
279  if(!menuLink)
280  {
281  continue;
282  }
283 
284  LoadMenu(menuObj, menuData, StrToGameState(menuLink), START);
285  }
286  return 0;
287 }
288 
289 /**
290  * Select the levels randomly from the available levels, stores in gSelectedLevels.
291  *
292  * @return 0 on success, -1 on error
293  *
294  * @author Anthony Rios
295  * @date 1/31/2016
296  */
298 {
299  int i, rand_i, *no_repeats, type_i;
300  int levels = 0;
301 
302  //Count
303  while(gLevels[levels])
304  {
305  levels++;
306  }
307  type_i = sizeof(int);
308 
309  //Alloc
310  gSelectedLevels = (char**) malloc(sizeof(char*)*levels+1);
311  no_repeats = (int*) malloc(sizeof(int)*(levels+1));
312  if(!gSelectedLevels) return -1;
313  if(!no_repeats) return -1;
314 
315  //Select
316  memset(no_repeats, 0, sizeof(int));
317  for (i = 0; i < gLevelsPerGame; i++)
318  {
319  rand_i = rand()%levels;
320  if(i >= levels)
321  {
322  break;
323  }
324  while(!CompareMemToMemArray(&rand_i, no_repeats, type_i, levels ))
325  {
326  rand_i = rand()%levels;
327  }
328  no_repeats[i] = rand_i;
329  gSelectedLevels[i] = gLevels[rand_i];
330  }
331  gSelectedLevels[i] = NULL;
332 
333  free(no_repeats);
334  return 0;
335 }
336 
337 /**
338  * Randomize selected levels.
339  *
340  * @author Anthony Rios
341  * @date 2/19/2016
342  */
344 {
345  int i, rand_i, *no_repeats;
346  char **slevel_copy;
347 
348  if (CountMem(gLevels, sizeof(char*)) < gLevelsPerGame)
349  {
350  printf("Levels less than min, Easy Mode - No Rand");
351  return;
352  }
353 
354  //Get a copy of gSelected
355  slevel_copy = (char**) malloc(sizeof(char*)*(gLevelsPerGame+1));
356  memcpy(slevel_copy, gSelectedLevels, sizeof(char*)*gLevelsPerGame);
357  slevel_copy[gLevelsPerGame] = 0;
358 
359  //No Repeats
360  no_repeats = (int*) malloc(sizeof(int)*gLevelsPerGame+1);
361  memset(no_repeats, 0, sizeof(int)*(gLevelsPerGame+1));
362 
363  //Randomize
364  for(i = 0; gSelectedLevels[i]; i++)
365  {
366  rand_i = rand()%gLevelsPerGame;
367  while(!CompareMemToMemArray(&rand_i, no_repeats, sizeof(int), gLevelsPerGame ))
368  {
369  rand_i = rand()%gLevelsPerGame;
370  }
371  no_repeats[i] = rand_i;
372  gSelectedLevels[i] = slevel_copy[rand_i];
373  }
374 
375  free(no_repeats);
376  free(slevel_copy);
377 }
378 
379 /**
380  * Loads selected level.
381  *
382  * @param level The level.
383  *
384  * @return The selected level.
385  *
386  * @see LoadLevel , in parselevel.c
387  * @author Anthony Rios
388  * @date 3/29/2016
389  */
390 int LoadSelectedLevel(int level)
391 {
392  if(!gSelectedLevels)
393  {
394  printf("Levels not Selected \n");
395  return -1;
396  }
397  if(!gSelectedLevels[level])
398  {
399  printf("Level %d not found \n", level);
400  return -1;
401  }
402  ConvertFileToUseable(gSelectedLevels[level], &gParser, &gLevelData, &gLevelTokens);
403  if(!gLevelData || !gLevelTokens)
404  {
405  printf("Unable to parse level %s \n", gSelectedLevels[level]);
406  }
407  gLevelObject = ParseToObject(gLevelTokens, gLevelData);
408  if(!gLevelObject)
409  {
410  printf("Unable to parse level %s to object \n", gSelectedLevels[level]);
411  }
412 
414  {
415  perror("Unable to Load level \n");
416  return -1;
417  }
418  return 0;
419 }
420 
421 /**
422  * Polls for all events and handles them.
423  *
424  * @author Anthony Rios
425  * @date 3/29/2016
426  */
427 void Poll()
428 {
429  if( SDL_PollEvent(&gEventQ) )
430  {
431  if(gEventQ.type == SDL_CONTROLLERDEVICEADDED || gEventQ.type == SDL_CONTROLLERDEVICEREMOVED)
432  {
433  gController = SDL_GameControllerOpen(0);
434  }
435  if(gEventQ.type == SDL_CONTROLLERBUTTONDOWN)
436  {
437  gButtonQ = (SDL_GameControllerButton) gEventQ.cbutton.button;
438  printf("Button Pressed : %d \n", gButtonQ);
439  } else
440  {
441  gButtonQ = (SDL_GameControllerButton) BUTTON_NO_INPUT;
442  }
443 
444  if( gEventQ.type == SDL_QUIT)
445  {
446  exitRequest = 1;
447  return;
448  }
449 
450  }
451 
452  return;
453 }
454 
455 
456 void UpdatePlaying();
457 
458 void Update()
459 {
460  char *splash;
461  gCurrentTime = SDL_GetTicks();
462  switch(gGameState)
463  {
464  case(SPLASH):
465  {
466  if(!gSplash)
467  {
469  if(!splash)
470  {
471  printf("SplashScreen key not found in gameData \n");
472  } else {
473  gSplash = LoadSprite(splash, 0);
474  if(!gSplash)
475  {
476  printf("Splash screen could not be loaded \n");
477  }
478  }
479  }
480  //If you pressed a button
481  if(gButtonQ != -1)
482  {
483  gGameState = START;
484  }
485  break;
486  }
487  case(START):
488  {
489  if(!gMenus)
490  {
491  printf("No menus loaded");
492  exitRequest = 1;
493  return;
494  }
495  if(gButtonQ != -1)
496  {
497  gMenus[0].Update(&gMenus[0], gButtonQ);
498  }
499 
500  break;
501  }
502  case(GUESS):
503  {
504  if(!gMenus)
505  {
506  printf("No menus loaded");
507  exitRequest = 1;
508  return;
509  }
510  if(gButtonQ != -1)
511  {
512  gMenus[1].Update(&gMenus[1], gButtonQ);
513  }
514  break;
515  }
516  case(CHOOSE):
517  {
518  if(!gMenus)
519  {
520  printf("No menus loaded");
521  exitRequest = 1;
522  return;
523  }
524  if(gButtonQ != -1)
525  {
526  gMenus[2].Update(&gMenus[2], gButtonQ);
527  }
528  break;
529  }
530  case(PLAYING):
531  {
532  UpdatePlaying();
533  break;
534  }
535  default:
536  break;
537  }
538 
539 }
540 
541 void DrawSplash();
542 void DrawStart();
543 void DrawGuess();
544 void DrawChoose();
545 void DrawPlaying();
546 
547 void Draw()
548 {
549  SDL_RenderClear(gRenderer);
550  switch(gGameState)
551  {
552  case(SPLASH):
553  {
554  DrawSplash();
555  break;
556  }
557  case(START):
558  {
559  DrawStart();
560  break;
561  }
562  case(CHOOSE):
563  {
564  DrawChoose();
565  break;
566  }
567  case(GUESS):
568  {
569  DrawGuess();
570  break;
571  }
572  case(PLAYING):
573  {
574  DrawPlaying();
575  break;
576  }
577  default:
578  break;
579  }
580  SDL_RenderPresent(gRenderer);
581  return;
582 }
583 
584 /**
585  * Loads files and images for game.
586  *
587  * @return state returns 0 on success, -1 on error
588  *
589  * @author Anthony Rios
590  * @date 1/31/2016
591  */
592 int Setup()
593 {
594  //sprite_t *test_sprite;
595  //vec2_t test_vec = {0,0};
596  srand(SDL_GetTicks());
597  //atexit(Shutdown);
598 
599  if(LoadGameData())
600  {
601  perror("Loading game data went wrong");
602  return -1;
603  }
604  if(InitGraphics())
605  {
606  perror("Initializing entity system went wrong");
607  return -1;
608  }
609  if(InitEntitySystem())
610  {
611  perror("Initializing entity system went wrong");
612  return -1;
613  }
614  if(InitMenuSystem())
615  {
616  perror("Initialize Menu system went wrong");
617  return -1;
618  }
619  if(InitAISystem())
620  {
621  perror("Initialize AI system went wrong");
622  return -1;
623  }
624  if(LoadEntityData())
625  {
626  perror("Loading entity data went wrong");
627  return -1;
628  }
629  if(LoadMenuData())
630  {
631  perror("Shit Happens");
632  return -1;
633  }
634  if(LoadLevelData())
635  {
636  perror("Loading level data went wrong");
637  return -1;
638  }
639  if(LoadPowerUpData())
640  {
641  perror("Loading entity data went wrong");
642  return -1;
643  }
644  if(SelectLevels())
645  {
646  perror("Selecting levels went wrong");
647  return -1;
648  }
649  gController = SDL_GameControllerOpen(0);
650  //PrintObject(gLevelObject, gLevelData);
651  //test_sprite = LoadSprite("Sprite/UI/NESController.png",0);
652  //test_sprite->mCurrentFrame = LoadAnimation(test_sprite->mSize.x, test_sprite->mSize.y, test_sprite->mSize.x, test_sprite->mSize.y);
653  //FreeSprite(test_sprite);
654 
655  return 0;
656 }
657 
658 /**
659  * Runs the main game loop.
660  *
661  * @return An int.
662  *
663  * @author Anthony Rios
664  * @date 3/29/2016
665  */
666 int Run()
667 {
668  while(!exitRequest)
669  {
670  Poll();
671  Update();
672  Draw();
673  gDelay = SDL_GetTicks() - gCurrentTime;
674  SDL_Delay(gDelay > FRAME_DELAY ? 0 : gDelay);
675  }
676  return 0;
677 }
678 
679 void Shutdown()
680 {
681 
682  return;
683 }
684 
685 /**
686  * Draws the splash screen.
687  *
688  * @author Anthony Rios
689  * @date 3/29/2016
690  */
692 {
693  if(gSplash)
694  {
695  if(DrawSprite(gSplash, NULL, &gZeroPos, gRenderer))
696  {
697  printf("Couldn't draw splash: %s \n", SDL_GetError());
698  }
699  }
700  return;
701 }
702 
703 /**
704  * Draws the start screen.
705  *
706  * @author Anthony Rios
707  * @date 3/29/2016
708  */
709 void DrawStart()
710 {
711  if(!gMenus)
712  {
713  printf("No menus loaded");
714  exitRequest = 1;
715  return;
716  }
717  gMenus[0].Draw(&gMenus[0]);
718  return;
719 }
720 
721 /**
722  * Draws the screen to player for powers to choose for this run.
723  *
724  * @author Anthony Rios
725  * @date 3/29/2016
726  */
727 void DrawGuess()
728 {
729  if(!gMenus)
730  {
731  printf("No menus loaded");
732  exitRequest = 1;
733  return;
734  }
735  gMenus[1].Draw(&gMenus[1]);
736  return;
737 }
738 
739 /**
740  * Draws the screen for the player to choose which powerUp he wants for this level.
741  *
742  * @author Anthony Rios
743  * @date 3/29/2016
744  */
746 {
747  if(!gMenus)
748  {
749  printf("No menus loaded");
750  exitRequest = 1;
751  return;
752  }
753  gMenus[2].Draw(&gMenus[2]);
754 
755 }
756 
757 /**
758  * Draws the main game state, which is playing the game.
759  *
760  * @author Anthony Rios
761  * @date 3/29/2016
762  */
764 {
765  DrawLevel();
766  DrawEntities();
767  return;
768 }
769 
770 /**
771  * Updates the playing game state.
772  *
773  * @author Anthony Rios
774  * @date 3/29/2016
775  */
777 {
778  RunEntities();
779  RunPhysics();
780 }
Definition: jsmn.h:40
int LoadMenuData()
Definition: game.c:250
int gDelay
Definition: game.c:23
entity_t * gEntityDictionary
Definition: game.c:41
char ** gLevels
Definition: game.c:26
int CountMem(void *src, int size_type)
Definition: mymath.c:51
int LoadGameData()
Definition: game.c:60
char ** gSelectedLevels
Definition: game.c:27
#define POWER_UPS_STR
Definition: globals.h:114
#define SCREEN_STRING
Definition: graphics.h:8
power_t * ParseToPowerUp(object_t *power, char *g_str)
Definition: parsepowerup.c:157
Definition: globals.h:87
GameState StrToGameState(char *str)
Definition: mystrings.c:274
int y
Definition: globals.h:22
#define SPLASH_SCREEN
Definition: game.h:9
object_t * FindObject(object_t *obj, char *name)
Definition: parseobject.c:120
char * JsmnToString(jsmntok_t *token, char *g_str)
Definition: mystrings.c:34
vec2_t * ParseToVec2(struct object_s *object, char *str)
#define LEVELS_NOT_DEFAULT
Definition: game.h:10
void RunPhysics()
Definition: dumb_physics.c:9
SDL_Renderer * gRenderer
Definition: graphics.c:10
int ConvertFileToUseable(char *fileName, jsmn_parser *parser, char **stringStorage, jsmntok_t **jsmnStorage)
Definition: mystrings.c:192
void DrawEntities()
Definition: entity.c:264
unsigned int gCurrentTime
Definition: game.c:50
vec2_t gZeroPos
Definition: game.c:46
void UpdatePlaying()
Definition: game.c:776
jsmntok_t * gEntityTokens
Definition: game.c:31
int gScreenWidth
Definition: graphics.c:16
SDL_GameController * gController
Definition: game.c:48
SDL_GameControllerButton gButtonQ
Definition: game.c:49
int gScreenHeight
Definition: graphics.c:17
#define BUTTON_NO_INPUT
char * gEntitiesFile
Definition: game.c:39
sprite_t * gSplash
Definition: game.c:45
char * gLevelData
Definition: game.c:38
int Run()
Definition: game.c:666
char ** gUsedPowerUps
Definition: game.c:29
power_t * gPowerUps
Definition: game.c:42
Definition: globals.h:88
object_t * gGameObject
Definition: game.c:33
int InitGraphics()
Definition: graphics.c:19
void DrawPlaying()
Definition: game.c:763
jsmntok_t * FindKey(jsmntok_t *token, char *key, char *g_str)
Definition: mystrings.c:10
int LoadLevel(object_t *level, char *g_str)
Definition: parselevel.c:11
object_t * gEntityObject
Definition: game.c:34
int CompareMemToMemArray(void *mem, void *mem_array, int size_type, int size_array)
Definition: mymath.c:77
void JsmnToInt(jsmntok_t *token, char *str, int *dst)
Definition: mystrings.c:84
#define LEVELS_DEFAULT
Definition: game.h:12
entity_t * ParseToEntity(object_t *object, char *str)
Definition: parseentity.c:70
void DrawGuess()
Definition: game.c:727
void PrintObject(object_t *obj, char *g_str)
Definition: parseobject.c:188
GameState gGameState
Definition: game.c:44
int InitEntitySystem()
Definition: entity.c:217
int LoadEntityData()
Definition: game.c:96
#define ENTITIES_FILE_STR
Definition: globals.h:106
#define JSON_FILE
Definition: game.h:7
int Setup()
Definition: game.c:592
jsmntok_t * gLevelTokens
Definition: game.c:32
char ** Hazards_str
Definition: entity.c:13
jsmntok_t * gGameTokens
Definition: game.c:30
int LoadSelectedLevel(int level)
Definition: game.c:390
void DrawLevel()
Definition: parselevel.c:248
char * gPowerUpsFile
Definition: game.c:40
void Poll()
Definition: game.c:427
void RandomizeSelectedLevels()
Definition: game.c:343
jsmn_parser gParser
Definition: game.c:25
char * gEntityData
Definition: game.c:37
int LoadLevelData()
Definition: game.c:148
char ** gSelectedPowerUps
Definition: game.c:28
#define FRAME_DELAY
Definition: globals.h:135
char ** ParseToStringArray(struct object_s *object, char *str)
void Shutdown()
Definition: game.c:679
sprite_t * LoadSprite(const char *name, int flags)
Definition: graphics.c:107
int exitRequest
Definition: game.c:22
int x
Definition: globals.h:21
object_t * gLevelObject
Definition: game.c:35
SDL_Event gEventQ
Definition: game.c:47
int SelectLevels()
Definition: game.c:297
int DrawSprite(sprite_t *sprite, int *frame, vec2_t *position, SDL_Renderer *renderer)
Definition: graphics.c:152
void Update()
Definition: game.c:458
char * FindValue(struct object_s *obj, char *key, char *g_str)
Definition: mystrings.c:53
char * gGameData
Definition: game.c:36
GameState
Definition: globals.h:83
int InitAISystem()
Definition: ai_interpret.c:646
object_t * ParseToObject(jsmntok_t *token, char *g_str)
Definition: parseobject.c:8
Definition: globals.h:86
entity_t * FindNextFreeCachePos()
Definition: entity.c:250
int gLevelsPerGame
Definition: game.c:24
void Draw()
Definition: game.c:547
int LoadPowerUpData()
Definition: game.c:196
void DrawChoose()
Definition: game.c:745
void RunEntities()
Definition: entity.c:281
void DrawStart()
Definition: game.c:709
void DrawSplash()
Definition: game.c:691
Definition: globals.h:85
char * gCurrentPowerUpName
Definition: game.c:43
Definition: globals.h:19