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 | Macros | Typedefs | Functions
level.h File Reference
#include <stdbool.h>
#include "mob.h"
#include "item.h"
#include "list.h"
Include dependency graph for level.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  Cell
 
struct  Level
 

Macros

#define LEVELWIDTH   80
 
#define LEVELHEIGHT   20
 

Typedefs

typedef struct Cell Cell
 
typedef struct Level Level
 

Functions

void build_level (Level *level)
 
void run_turn (Level *level)
 
void display_level (Level *level)
 

Macro Definition Documentation

#define LEVELHEIGHT   20

The height of a level in characters.

#define LEVELWIDTH   80

The width of a level in characters.

Typedef Documentation

typedef struct Cell Cell

A cell is an individual space in a level, they have a base symbol, may be solid, may contain at most one occupant mob, and a list of items.

typedef struct Level Level

A level is the current part of the game which is active, it gets rendered to the screen, has a bunch of mobs, and a single player. Levels form a doubly-linked list.

Function Documentation

void build_level ( Level level)

Initialises a level.

Parameters
levelLevel to initialise.

Here is the call graph for this function:

Here is the caller graph for this function:

void display_level ( Level level)

Render the level to the screen. The symbol for a level is picked according to the following priorities: occupant > top item > base.

Parameters
levelGrid to display.

Here is the call graph for this function:

Here is the caller graph for this function:

void run_turn ( Level level)

A "turn" consists of all of the mobs acting once, possibly followed by some constant effect on the mob. As the player is a turn, this is (indirectly) where blocking for input happens.

Parameters
levelThe level grid to run the turn on.

Here is the call graph for this function:

Here is the caller graph for this function: