Dumb-ways-to-memorize
2D game
Data Structures | Macros | Typedefs | Enumerations | Functions | Variables
globals.h File Reference
#include <jsmn.h>
+ Include dependency graph for globals.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  vec2_t
 
struct  KV_Pair_t
 

Macros

#define STRING_TYPE(X)
 
#define SIGN_BIT   0xF000
 
#define HAZARD_NULL   0x0
 
#define HAZARD_MAX   (0x1 >> 31)
 
#define HAZARD_DAMAGE   10
 
#define HAZARD_STUN_FRAMES   10
 
#define ENTITIES_FILE_STR   "Entities"
 
#define POWER_UPS_STR   "PowerUps"
 
#define G_NAME_STR   "Name"
 
#define LOC_NAME_STR   "name"
 
#define FRAME_DELAY   13
 
#define PHYSICS_LIMITER   2
 

Typedefs

typedef unsigned int address_t
 

Enumerations

enum  entity_state_t {
  ENTITY_STATE_DEAD,
  ENTITY_STATE_ALIVE,
  ENTITY_STATE_OTHER
}
 
enum  collision_type_t {
  COLLISION_TYPE_STATIC,
  COLLISION_TYPE_RAGDOLL,
  COLLISION_TYPE_CLIP
}
 
enum  menu_item_state_t {
  MENU_ITEM_STATE_NULL,
  MENU_ITEM_STATE_SELECTED = 0x1,
  MENU_ITEM_STATE_NOT_SELECTED = 0x2,
  MENU_ITEM_STATE_PICKED = 0x4,
  MENU_ITEM_STATE_MAX = 0x8
}
 
enum  animation_state_t {
  ANIMATION_IDLE,
  ANIMATION_WALK,
  ANIMATION_JUMP,
  ANIMATION_ATTACK,
  ANIMATION_HIT,
  ANIMATION_MAX = 20
}
 
enum  GameState {
  SPLASH = 0x1,
  START = 0x2,
  GUESS = 0x4,
  CHOOSE = 0x8,
  PLAYING = 0x10,
  END = 0x20
}
 

Functions

void Vec2Add (vec2_t *A, vec2_t *B, vec2_t *C)
 
void Vec2Subtract (vec2_t *First, vec2_t *Second, vec2_t *C)
 
void Vec2MultiplyScalar (vec2_t *A, int B, vec2_t *C)
 
int LargestDivisor (int num)
 
GameState StrToGameState (char *str)
 
int StrToMenuType (char *str)
 
int StrToHazard (char *str)
 
collision_type_t StrToCollisionType (char *str)
 
entity_state_t StrToEntityState (char *str)
 
int SelectLevels ()
 
int LoadSelectedLevel (int level)
 
void RandomizeSelectedLevels ()
 
int CountMem (void *src, int size_type)
 
int AllocateDynamic (void **dst, void *src, int size_type, int size)
 
int CompareMemToMemArray (void *mem, void *mem_array, int size_type, int size_array)
 
vec2_tParseToVec2 (struct object_s *object, char *str)
 
char ** ParseToStringArray (struct object_s *object, char *str)
 

Variables

vec2_t gZeroPos
 
GameState gGameState
 
char ** Hazards_str
 
char * gEntitiesFile
 
char * Collisions_str []
 
char * EntityStates_str []
 
char * gPowerUpsFile
 
vec2_tmousePos
 
int * keyPower
 
char ** gSelectedPowerUps
 
char ** gUsedPowerUps
 
char * gCurrentPowerUpName
 
char ** gLevels
 
char ** gSelectedLevels
 
void * gWorld
 
void * gMouse
 
int gPlayerLives
 
int gLevelsPerGame
 
int gScreenWidth
 
int gScreenHeight
 
unsigned int gCurrentTime
 
vec2_t gGravity
 
int exitRequest
 
jsmn_parser gParser
 
jsmntok_tgGameTokens
 
struct object_sgGameObject
 
jsmntok_tgEntityTokens
 
struct object_sgEntityObject
 
jsmntok_tgLevelTokens
 
struct object_sgLevelObject
 
char * gGameData
 
char * gEntityData
 
char * gLevelData
 

Macro Definition Documentation

#define ENTITIES_FILE_STR   "Entities"

Definition at line 106 of file globals.h.

Referenced by LoadGameData().

#define FRAME_DELAY   13
#define G_NAME_STR   "Name"

Definition at line 133 of file globals.h.

Referenced by LoadLevel().

#define HAZARD_DAMAGE   10

Definition at line 100 of file globals.h.

Referenced by TouchGeneric(), and TouchPlayer().

#define HAZARD_MAX   (0x1 >> 31)

Definition at line 99 of file globals.h.

#define HAZARD_NULL   0x0

Definition at line 98 of file globals.h.

#define HAZARD_STUN_FRAMES   10

Definition at line 101 of file globals.h.

Referenced by TouchGeneric(), and TouchPlayer().

#define LOC_NAME_STR   "name"

Definition at line 134 of file globals.h.

#define PHYSICS_LIMITER   2

Definition at line 136 of file globals.h.

Referenced by RunPhysics().

#define POWER_UPS_STR   "PowerUps"

Definition at line 114 of file globals.h.

Referenced by LoadGameData().

#define SIGN_BIT   0xF000

Definition at line 16 of file globals.h.

#define STRING_TYPE (   X)
Value:
(X == sizeof(char) ? "Char" \
: (X == sizeof(int) ? "Int" \
: (X == sizeof(jsmntok_t) ? "Jsmn" \
: "Unkown" ) ) )
Definition: jsmn.h:40

Returns string of the type of size X

Definition at line 6 of file globals.h.

Typedef Documentation

typedef unsigned int address_t

Definition at line 28 of file globals.h.

Enumeration Type Documentation

Defines an enum for animation states in mSprites array

Enumerator
ANIMATION_IDLE 

An enum constant representing the idle animation

ANIMATION_WALK 

An enum constant representing the walk animation

ANIMATION_JUMP 

An enum constant representing the jump animation

ANIMATION_ATTACK 

An enum constant representing the attack animation

ANIMATION_HIT 

An enum constant representing the hit animation

ANIMATION_MAX 

An enum constant representing the maximum animations

Definition at line 71 of file globals.h.

80 {

Defines the enum which are the collision types for the physics engine

Enumerator
COLLISION_TYPE_STATIC 

An enum constant representing the collision type static - which means it collides, but doesn't move

COLLISION_TYPE_RAGDOLL 

An enum constant representing the collision type ragdoll - which collides + moves

COLLISION_TYPE_CLIP 

An enum constant representing the collision type clip - which means it doesn't collide , but moves. Should be used for particle entities (maybe)

Definition at line 53 of file globals.h.

58 {

Defines the enum relating to entity states

Enumerator
ENTITY_STATE_DEAD 

An enum constant representing the entity state dead

ENTITY_STATE_ALIVE 

An enum constant representing the entity state alive option

ENTITY_STATE_OTHER 

An enum constant representing the entity state other, which is used for non-health based entities

Definition at line 45 of file globals.h.

50 {
enum GameState

Defines the enum for the game states

Enumerator
SPLASH 

An enum constant representing the splash screen game state

START 

An enum constant representing the start screen game state

GUESS 

An enum constant representing the first time the player chooses the power_ups

CHOOSE 

An enum constant representing the state in which the player selects a power_up from the chosen power ups in guess

PLAYING 

An enum constant representing the playing game state, which is consistent of the level, enemy entities, and the player

END 

An enum constant representing the player has chosen to quit the game

Definition at line 83 of file globals.h.

Defines the enum for menu item states

Enumerator
MENU_ITEM_STATE_NULL 
MENU_ITEM_STATE_SELECTED 

An enum constant representing the menu item state selected - which means the player is hovering over this now

MENU_ITEM_STATE_NOT_SELECTED 

An enum constant representing the menu item state not selected

MENU_ITEM_STATE_PICKED 

An enum constant representing the menu item state picked - which is a option that is checked

MENU_ITEM_STATE_MAX 

Definition at line 61 of file globals.h.

68 {

Function Documentation

int AllocateDynamic ( void **  dst,
void *  src,
int  size_type,
int  size 
)

Allocate memory and copy over src into it. Adds Null to end. Returns NULL on size 0

Parameters
[in,out]dstIf non-null, destination for the allocation.
[in,out]srcIf non-null, source for the adding.
size_typeSize of the type.
sizeThe size.
Returns
0 on success, -1 on error.
Author
Anthony Rios
Date
2/1/2016

Definition at line 66 of file mymath.c.

Referenced by CopyObjectToObjectArray(), and ParseToObject().

67 {
68  int offset = size_type/sizeof(int);
69  if(!dst) return -1;
70  *dst = realloc(*dst, size_type*(size+1));
71  if(!*dst) return -1;
72  src ? memcpy((int*)(*dst)+(size-1)*offset, src, size_type) : memset((int*)(*dst)+(size-1)*offset, 0, size_type);
73  memset((int*)(*dst)+(size)*offset, 0, size_type);
74  return 0;
75 }
int CompareMemToMemArray ( void *  mem,
void *  mem_array,
int  size_type,
int  size_array 
)

Compare memory to memory array.

Parameters
[in,out]memIf non-null, the memory.
[in,out]mem_arrayIf non-null, array of memories.
size_typeSize of type, via sizeof() function.
size_arraySize of Array.
Returns
0 if equal, -1 if not.
Author
Anthony Rios
Date
1/31/2016

Definition at line 77 of file mymath.c.

Referenced by RandomizeSelectedLevels(), and SelectLevels().

78 {
79  int i, offset;
80  int *memory = (int*) mem_array;
81  offset = size_type;
82  for(i = 0; i < size_array; i++)
83  {
84  if(!memcmp(mem, memory, size_type))
85  {
86  return 0;
87  }
88  memory += offset;
89  }
90  return -1;
91 }
int CountMem ( void *  src,
int  size_type 
)

Counts the memory of type size_type, given that the final address is null.

Parameters
[in,out]srcIf non-null, source of memory.
size_typeSize of the type.
Returns
The total number of memory, if src is null 0 is returned.
Author
Anthony Rios
Date
2/1/2016

Definition at line 51 of file mymath.c.

Referenced by CopyObjectToObjectArray(), CountObjectChildren(), CountObjectMembers(), DoPlayerThink(), FindKey(), FindMenuItem(), FindPower(), FindValue(), IncrementFrame(), LoadEntityData(), LoadLevel(), LoadLevelData(), LoadMenu(), LoadMenuData(), LoadPowerUpData(), ParseAI(), ParsePresetAI(), ParseToEntity(), ParseToStringArray(), PrintObject(), ProcessMenuItemsByType(), RandomizeSelectedLevels(), StrToHazard(), TouchGeneric(), TouchGoal(), TouchPlayer(), UpdatePowerSelectMenu(), UpdatePowerUpMenu(), and UpdateVerticalMenu().

52 {
53  int i, offset;
54  int *source = (int*)src;
55  if(source == NULL)
56  return 0;
57  i = 0; offset = size_type/sizeof(int);
58  while( *(source) )
59  {
60  source += offset;
61  i++;
62  }
63  return i;
64 }
int LargestDivisor ( int  num)

Definition at line 5 of file mymath.c.

Referenced by ProcessMenuItemsByType().

6 {
7  int i, root, hit;
8  hit = 0;
9  root = num>>1;
10  for(i = 0; i < root; i++)
11  {
12  if(!num%i)
13  {
14  hit = i;
15  }
16  }
17  return hit;
18 }
int LoadSelectedLevel ( int  level)

Loads selected level.

Parameters
levelThe level.
Returns
The selected level.
See also
LoadLevel , in parselevel.c
Author
Anthony Rios
Date
3/29/2016

Definition at line 390 of file game.c.

References ConvertFileToUseable(), gLevelData, gLevelObject, gSelectedLevels, LoadLevel(), and ParseToObject().

Referenced by UpdatePowerSelectMenu().

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  }
403  if(!gLevelData || !gLevelTokens)
404  {
405  printf("Unable to parse level %s \n", gSelectedLevels[level]);
406  }
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 }
char ** gSelectedLevels
Definition: game.c:27
int ConvertFileToUseable(char *fileName, jsmn_parser *parser, char **stringStorage, jsmntok_t **jsmnStorage)
Definition: mystrings.c:192
char * gLevelData
Definition: game.c:38
int LoadLevel(object_t *level, char *g_str)
Definition: parselevel.c:11
jsmntok_t * gLevelTokens
Definition: game.c:32
jsmn_parser gParser
Definition: game.c:25
object_t * gLevelObject
Definition: game.c:35
object_t * ParseToObject(jsmntok_t *token, char *g_str)
Definition: parseobject.c:8
char** ParseToStringArray ( struct object_s object,
char *  str 
)

Parse obj/data to string array.

Parameters
[in,out]objectIf non-null, the object.
[in,out]strIf non-null, the string.
Returns
null if it fails, else a handle to a char.
Author
Anthony Rios
Date
3/29/2016

Referenced by LoadEntityData(), and LoadLevel().

vec2_t* ParseToVec2 ( struct object_s object,
char *  str 
)

Parse given obj/str to vector 2.

Parameters
[in,out]objectIf non-null, the object.
[in,out]strIf non-null, the string.
Returns
null if it fails, else a pointer to a vec2_t.
Author
Anthony Rios
Date
3/29/2016

Referenced by LoadGameData(), LoadLevel(), ParseToEntity(), and SetAI_Action().

void RandomizeSelectedLevels ( )

Randomize selected levels.

Author
Anthony Rios
Date
2/19/2016

Definition at line 343 of file game.c.

References CompareMemToMemArray(), CountMem(), gLevels, gLevelsPerGame, and gSelectedLevels.

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 }
char ** gLevels
Definition: game.c:26
int CountMem(void *src, int size_type)
Definition: mymath.c:51
char ** gSelectedLevels
Definition: game.c:27
int CompareMemToMemArray(void *mem, void *mem_array, int size_type, int size_array)
Definition: mymath.c:77
int gLevelsPerGame
Definition: game.c:24
int SelectLevels ( )

Select the levels randomly from the available levels, stores in gSelectedLevels.

Returns
0 on success, -1 on error
Author
Anthony Rios
Date
1/31/2016

Definition at line 297 of file game.c.

References CompareMemToMemArray(), gLevels, gLevelsPerGame, and gSelectedLevels.

Referenced by Setup().

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 }
char ** gLevels
Definition: game.c:26
char ** gSelectedLevels
Definition: game.c:27
int CompareMemToMemArray(void *mem, void *mem_array, int size_type, int size_array)
Definition: mymath.c:77
int gLevelsPerGame
Definition: game.c:24
collision_type_t StrToCollisionType ( char *  str)

Converts a string into a entity collision type

Converts a str to a collision type.

Parameters
[in,out]strIf non-null, the string.
Returns
str as a collision_type_t.
Author
Anthony Rios
Date
3/29/2016

Definition at line 344 of file mystrings.c.

References COLLISION_TYPE_CLIP, and Collisions_str.

Referenced by ParseComplexMember().

345 {
346  int i;
347  if(!str)
348  return 0;
349  for(i = 0; i <= COLLISION_TYPE_CLIP; i++)
350  {
351  if(!strcmp(Collisions_str[i], str))
352  {
353  return (collision_type_t)i;
354  }
355  }
356  return 0;
357 }
collision_type_t
Definition: globals.h:53
char * Collisions_str[]
Definition: entity.c:14
entity_state_t StrToEntityState ( char *  str)

Converts a string into an entity state

Converts a str to an entity state.

Parameters
[in,out]strIf non-null, the string.
Returns
str as an entity_state_t.
Author
Anthony Rios
Date
3/29/2016

Definition at line 370 of file mystrings.c.

References COLLISION_TYPE_CLIP, and EntityStates_str.

Referenced by ParseComplexMember().

371 {
372  int i;
373  if(!str)
374  return 0;
375  for(i = 0; i <= COLLISION_TYPE_CLIP; i++)
376  {
377  if(!strcmp(EntityStates_str[i], str))
378  {
379  return (entity_state_t)i;
380  }
381  }
382  return 0;
383 }
entity_state_t
Definition: globals.h:45
char * EntityStates_str[]
Definition: entity.c:15
GameState StrToGameState ( char *  str)

Converts a string into a game state

Converts a str to a game state.

Parameters
[in,out]strIf non-null, the string.
Returns
str as a GameState.
Author
Anthony Rios
Date
3/29/2016

Definition at line 274 of file mystrings.c.

References CHOOSE, END, GAME_STATE_CHOOSE_STR, GAME_STATE_END_STR, GAME_STATE_GUESS_STR, GAME_STATE_PLAYING_STR, GAME_STATE_SPLASH_STR, GAME_STATE_START_STR, GUESS, PLAYING, SPLASH, and START.

Referenced by LoadMenu(), and LoadMenuData().

275 {
276  if(!str)
277  {
278  return SPLASH;
279  }
280  else if(!strcmp(str, GAME_STATE_SPLASH_STR))
281  {
282  return SPLASH;
283  }
284  else if(!strcmp(str, GAME_STATE_START_STR))
285  {
286  return START;
287  }
288  else if(!strcmp(str, GAME_STATE_GUESS_STR))
289  {
290  return GUESS;
291  } else if(!strcmp(str, GAME_STATE_CHOOSE_STR))
292  {
293  return CHOOSE;
294  }
295  else if(!strcmp(str, GAME_STATE_PLAYING_STR))
296  {
297  return PLAYING;
298  }
299  if(!strcmp(str, GAME_STATE_END_STR))
300  {
301  return END;
302  }
303  return SPLASH;
304 }
Definition: globals.h:87
#define GAME_STATE_CHOOSE_STR
Definition: mystrings.h:12
#define GAME_STATE_SPLASH_STR
Definition: mystrings.h:9
#define GAME_STATE_START_STR
Definition: mystrings.h:10
Definition: globals.h:88
#define GAME_STATE_END_STR
Definition: mystrings.h:14
#define GAME_STATE_PLAYING_STR
Definition: mystrings.h:13
Definition: globals.h:86
Definition: globals.h:85
#define GAME_STATE_GUESS_STR
Definition: mystrings.h:11
Definition: globals.h:90
int StrToHazard ( char *  str)

Converts a string into a hazard, using the parsed hazards_str for comparison

Converts a str to a hazard.

Parameters
[in,out]strIf non-null, the string.
Returns
str as an int.
Author
Anthony Rios
Date
3/29/2016

Definition at line 317 of file mystrings.c.

References CountMem(), and Hazards_str.

Referenced by ParseComplexMember().

318 {
319  int i, length;
320  if(!str)
321  return 0;
322  length = CountMem(Hazards_str, sizeof(char*));
323  for(i = 0; i < length; i++)
324  {
325  if(!strcmp(str, Hazards_str[i]))
326  {
327  return (1 << i);
328  }
329  }
330  return 0;
331 }
int CountMem(void *src, int size_type)
Definition: mymath.c:51
char ** Hazards_str
Definition: entity.c:13
int StrToMenuType ( char *  str)

Converts a string into a menu type

Definition at line 697 of file menu.c.

References MENU_TYPE_CHOOSE, MENU_TYPE_GRID, MENU_TYPE_H, MENU_TYPE_NULL, MENU_TYPE_POWER, MENU_TYPE_STR_CHOOSE, MENU_TYPE_STR_GRID, MENU_TYPE_STR_H, MENU_TYPE_STR_POWER, MENU_TYPE_STR_V, and MENU_TYPE_V.

Referenced by LoadMenu().

698 {
699  if(!strcmp(str, MENU_TYPE_STR_H))
700  {
701  return MENU_TYPE_H;
702  }
703  if(!strcmp(str, MENU_TYPE_STR_V))
704  {
705  return MENU_TYPE_V;
706  }
707  if(!strcmp(str, MENU_TYPE_STR_GRID))
708  {
709  return MENU_TYPE_GRID;
710  }
711  if(!strcmp(str, MENU_TYPE_STR_POWER))
712  {
713  return MENU_TYPE_POWER;
714  }
715  if(!strcmp(str, MENU_TYPE_STR_CHOOSE))
716  {
717  return MENU_TYPE_CHOOSE;
718  }
719  return MENU_TYPE_NULL;
720 }
void Vec2Add ( vec2_t A,
vec2_t B,
vec2_t C 
)

Definition at line 20 of file mymath.c.

References vec2_t::x, and vec2_t::y.

Referenced by DoCollision(), JumpAI(), MoveAI(), RunPhysics(), Spawn(), and WalkAI().

21 {
22  if(!A || !B || !C)
23  {
24  return;
25  }
26  C->x = A->x + B->x;
27  C->y = A->y + B->y;
28 }
int y
Definition: globals.h:22
int x
Definition: globals.h:21
void Vec2MultiplyScalar ( vec2_t A,
int  B,
vec2_t C 
)

Definition at line 41 of file mymath.c.

References vec2_t::x, and vec2_t::y.

Referenced by JumpAI(), MoveAI(), and WalkAI().

42 {
43  if(!A || !C)
44  {
45  return;
46  }
47  (*C).x = A->x * B;
48  (*C).y = A->y * B;
49 }
int y
Definition: globals.h:22
int x
Definition: globals.h:21
void Vec2Subtract ( vec2_t First,
vec2_t Second,
vec2_t C 
)

Definition at line 31 of file mymath.c.

References vec2_t::x, and vec2_t::y.

32 {
33  if(!First || !Second || !C)
34  {
35  return;
36  }
37  C->x = First->x - Second->x;
38  C->y = First->y - Second->y;
39 }
int y
Definition: globals.h:22
int x
Definition: globals.h:21

Variable Documentation

char* Collisions_str[]

The collisions type strings for parsing

Definition at line 14 of file entity.c.

Referenced by StrToCollisionType().

char* EntityStates_str[]

The entity state strings for parsing

Definition at line 15 of file entity.c.

Referenced by StrToEntityState().

int exitRequest

The integer to be changed to exit

Definition at line 22 of file game.c.

Referenced by DrawChoose(), DrawGuess(), DrawStart(), InitPlayer(), Poll(), Run(), and Update().

char* gCurrentPowerUpName

The current power up name

Definition at line 43 of file game.c.

Referenced by UpdatePowerSelectMenu().

unsigned int gCurrentTime

The current time , updated from last update call

Definition at line 50 of file game.c.

Referenced by InitPlayer(), JumpAI(), MoveAI(), NothingAI(), Run(), RunEntities(), ThinkGeneric(), ThinkPlayer(), Update(), and WalkAI().

char* gEntitiesFile

The name of the entities file

Definition at line 39 of file game.c.

Referenced by LoadEntityData(), and LoadGameData().

char* gEntityData

The current parsed string of the entity file

Definition at line 37 of file game.c.

Referenced by LoadEntityData().

struct object_s* gEntityObject

The entity object

Definition at line 34 of file game.c.

Referenced by LoadEntityData().

jsmntok_t* gEntityTokens

The entity jsmn tokens

Definition at line 31 of file game.c.

char* gGameData

Game Data File - holding the contents of file via string

Definition at line 36 of file game.c.

Referenced by LoadEntityData(), LoadGameData(), LoadLevelData(), LoadMenuData(), LoadPowerUpData(), Update(), and UpdatePowerUpMenu().

struct object_s* gGameObject

The game object

Definition at line 33 of file game.c.

Referenced by LoadEntityData(), LoadGameData(), LoadLevelData(), LoadMenuData(), LoadPowerUpData(), Update(), and UpdatePowerUpMenu().

GameState gGameState

State of the game

Definition at line 44 of file game.c.

Referenced by Draw(), ThinkPlayer(), TouchGoal(), Update(), UpdatePowerSelectMenu(), UpdatePowerUpMenu(), and UpdateVerticalMenu().

jsmntok_t* gGameTokens

Tokens for GameData

Definition at line 30 of file game.c.

vec2_t gGravity

The gravity which affects all the assets

Definition at line 7 of file dumb_physics.c.

char* gLevelData

Information describing the current level

Definition at line 38 of file game.c.

Referenced by LoadSelectedLevel().

struct object_s* gLevelObject

The current level object

Definition at line 35 of file game.c.

Referenced by LoadSelectedLevel().

char** gLevels

The level names

Definition at line 26 of file game.c.

Referenced by LoadLevelData(), RandomizeSelectedLevels(), and SelectLevels().

int gLevelsPerGame

The levels per game

Definition at line 24 of file game.c.

Referenced by LoadLevelData(), RandomizeSelectedLevels(), SelectLevels(), and UpdatePowerUpMenu().

jsmntok_t* gLevelTokens

The level jsmn tokens

Definition at line 32 of file game.c.

void* gMouse
jsmn_parser gParser

The global jsmn parser

Definition at line 25 of file game.c.

int gPlayerLives

The lives of the player

Definition at line 10 of file player.c.

Referenced by DecrementPlayerLives(), InitPlayer(), and ThinkPlayer().

char* gPowerUpsFile

The name of the power ups file

Definition at line 40 of file game.c.

Referenced by LoadGameData(), and LoadPowerUpData().

int gScreenHeight

Te set Height of the screen

Definition at line 17 of file graphics.c.

Referenced by ApplyBounds(), InitGraphics(), LoadGameData(), and ProcessMenuItemsByType().

int gScreenWidth

The set Width of the screen

Definition at line 16 of file graphics.c.

Referenced by ApplyBounds(), InitGraphics(), LoadGameData(), and ProcessMenuItemsByType().

char** gSelectedLevels

The selected levels to load

Definition at line 27 of file game.c.

Referenced by LoadSelectedLevel(), RandomizeSelectedLevels(), and SelectLevels().

char** gSelectedPowerUps

The power ups the player selects

Definition at line 28 of file game.c.

Referenced by LoadMenu(), TouchGoal(), UpdatePowerSelectMenu(), and UpdatePowerUpMenu().

char** gUsedPowerUps

The used power ups for this game run

Definition at line 29 of file game.c.

Referenced by TouchGoal(), UpdatePowerSelectMenu(), and UpdatePowerUpMenu().

void* gWorld
vec2_t gZeroPos

Definition at line 46 of file game.c.

Referenced by InitPlayer().

char** Hazards_str

The hazards string array which is defined in the gamedata file

Definition at line 13 of file entity.c.

Referenced by LoadEntityData(), and StrToHazard().

int* keyPower

The key press related to using the power

Definition at line 18 of file parsepowerup.c.

Referenced by CallInfo(), and ParseToPowerUp().

vec2_t* mousePos

The mouse position

Definition at line 17 of file parsepowerup.c.