Still won't work

Dependencies:   mbed wave_player 4DGL-uLCD-SE MMA8452

Embed: (wiki syntax)

« Back to documentation index

MapItem Struct Reference

MapItem Struct Reference

The data for elements in the map. More...

#include <map.h>

Data Fields

int type
 Indicates the "type" of the MapItem: WALL, DOOR, PLANT, etc.
DrawFunc draw
 A function pointer to the drawing function for this item.
int walkable
 If zero, this item should block character motion.
void * data
 Arbitrary extra data for the MapItem.

Detailed Description

The data for elements in the map.

Each item in the map HashTable is a MapItem.

Definition at line 20 of file map.h.


Field Documentation

void* data

Arbitrary extra data for the MapItem.

Could be useful for keeping up with special information, like where a set of stairs should take the player.

Iterpretation of this can depend on the type of the MapItem. For example, a WALL probably doesn't need to use this (it can be NULL), where an NPC might use it to store game state (have I given the player the key yet?).

Definition at line 46 of file map.h.

DrawFunc draw

A function pointer to the drawing function for this item.

Used by draw_game.

Definition at line 31 of file map.h.

int type

Indicates the "type" of the MapItem: WALL, DOOR, PLANT, etc.

This is useful for determining how to interact with the object when updating the game state.

Definition at line 26 of file map.h.

int walkable

If zero, this item should block character motion.

Definition at line 36 of file map.h.