Atrinik Client 2.5
Defines | Functions | Variables
events/move.c File Reference
#include <global.h>

Go to the source code of this file.

Defines

#define DIRECTIONS_NUM   9

Functions

void move_keys (int num)
int dir_from_tile_coords (int tx, int ty)

Variables

static const char *const directions_move [DIRECTIONS_NUM]
static const char *const directions_run [DIRECTIONS_NUM]
static const int directions_fire [DIRECTIONS_NUM]

Detailed Description

Handles movement events.

Definition in file move.c.


Define Documentation

#define DIRECTIONS_NUM   9

Number of the possible directions.

Definition at line 34 of file move.c.


Function Documentation

int dir_from_tile_coords ( int  tx,
int  ty 
)

Transform tile coordinates into direction, which can be used as a result for functions like move_keys() or directions_move (return value - 1).

Parameters:
txTile X.
tyTile Y.
Returns:
The direction, 1-9.

Definition at line 147 of file move.c.


Variable Documentation

const int directions_fire[DIRECTIONS_NUM] [static]
Initial value:
{
    6, 5, 4, 7, 0, 3, 8, 1, 2
}

Directions to fire into.

Definition at line 52 of file move.c.

const char* const directions_move[DIRECTIONS_NUM] [static]
Initial value:
{
    "/sw", "/s", "/se", "/w", "/stay", "/e", "/nw", "/n", "/ne"
}

Directions to move into.

Definition at line 38 of file move.c.

const char* const directions_run[DIRECTIONS_NUM] [static]
Initial value:
{
    "/run 6", "/run 5", "/run 4", "/run 7", "/run 9", "/run 3", "/run 8", "/run 1", "/run 2"
}

Directions to run into.

Definition at line 45 of file move.c.