Ludum Dare 29
HackSoc's entry for the Ludum Dare Jam 29
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Data Structures | Typedefs | Functions
player.h File Reference
#include "level.h"
Include dependency graph for player.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  Terrain
 
struct  PlayerData
 

Typedefs

typedef struct Terrain Terrain
 
typedef struct PlayerData PlayerData
 

Functions

Mobcreate_player (void)
 
bool attackmove (struct Mob *player, unsigned int xdiff, unsigned int ydiff)
 
bool attackmove_relative (struct Mob *player, int xdiff, int ydiff)
 
void player_turn (Mob *player)
 
void player_death (Mob *player)
 

Typedef Documentation

typedef struct PlayerData PlayerData

Data specific to the player

typedef struct Terrain Terrain

Record of what the player has seen in a level

Function Documentation

bool attackmove ( Mob player,
unsigned int  x,
unsigned int  y 
)

Move and attack at the same time - if a mob is in the target cell, damage it, but don't move.

Parameters
playerEntity representing the player.
xx-coordinate to move to.
yy-coordinate to move to.
Returns
If the player damaged a mob.

Here is the call graph for this function:

Here is the caller graph for this function:

bool attackmove_relative ( Mob player,
int  xdiff,
int  ydiff 
)

Like attackmove, but relative position.

Parameters
playerEntity representing the player.
xdiffDifference in the x-axis to move.
ydiffDifference in the y-axis to move.
Returns
If the player damaged a mob.

Here is the call graph for this function:

Here is the caller graph for this function:

Mob* create_player ( void  )

Create and return a new player. This prompts the user for stuff, and clears the screen when it is done.

Here is the call graph for this function:

Here is the caller graph for this function:

void player_death ( Mob player)

Say that the player is dead, and do stuff.

Parameters
playerPlayer that died.

Here is the call graph for this function:

Here is the caller graph for this function:

void player_turn ( Mob player)

Wait for user input, and then act accordingly.

Parameters
playerPlayer entity.

Here is the call graph for this function:

Here is the caller graph for this function: