Agar

<-- Back to AG_Intro.3

SYNOPSIS

#include <agar/core.h>

DESCRIPTION

The MAP_Actor class describes all dynamic objects that can assume some position inside of a MAP(3). This class also provides an interface for handling user input.

INHERITANCE HIERARCHY

AG_Object(3)-> MAP_Actor.

INITIALIZATION


MAP_Actor * MAP_ActorNew (AG_Object *parent, const char *name)

int MAP_ActorMapTile (MAP_Actor *actor, int x, int y, int layer0, RG_Tileset *ts, const char *tileName)

void MAP_ActorUnmapTile (MAP_Actor *actor)

int MAP_ActorSetTile (MAP_Actor *actor, int x, int y, int layer0, RG_Tileset *ts, const char *tileName)

void MAP_ActorMoveTile (MAP_Actor *actor, int dx, int dy)


The MAP_ActorNew() function allocates, initializes, and attaches a new MAP_Actor object.

The MAP_ActorMapTile() function looks up the given RG_Tileset(3) for a RG_Tile(3) called tileName. If the tile is found, it is divided into square fragments (of dimensions MAPTILESZ) and inserted onto the actor's parent map at position x, y relative to the current position of the actor.

The MAP_ActorUnmapTile() function removes all tile fragments related to this actor from its parent map.

MAP_ActorSetTile() is a shorthand for MAP_ActorUnmapTile() followed by MAP_ActorMapTile().

The MAP_ActorMoveTile() function displaces all tile fragments related to this actor on the map by dx and dy pixels.

SEE ALSO

AG_Object(3), MAP(3), MAP_View(3), SG_Intro(3)

HISTORY

The MAP_Actor object first appeared in Agar 1.0.
Csoft.net ElectronTubeStore.com