Bullet Elf
[Example Tank]


Classes

struct  _tank_bullet
 Information about bullet elf. More...
static void make_bullet_elf_coords (redraw_man_t *rdman, coord_t **coord_pos, coord_t **coord_rot, coord_t **coord_center)
 Make coord objects for bullet elfs.
static tank_bullet_ttank_bullet_new (redraw_man_t *rdman, int map_x, int map_y, int direction)
static void tank_bullet_free (tank_bullet_t *bullet)
static void bullet_go_out_map (event_t *event, void *arg)
static void bullet_bang (tank_bullet_t *bullet, int map_x, int map_y)
static void bullet_hit_chk (const mb_timeval_t *tmo, const mb_timeval_t *now, void *arg)
 To check if a bullet hits walls or tanks.
static void tank_fire_bullet (tank_rt_t *tank_rt, tank_t *tank)
 To fire a bullet for a tank.

Typedefs

typedef struct _tank_bullet tank_bullet_t

Enumerations

enum  { BU_UP = 0, BU_RIGHT, BU_DOWN, BU_LEFT }
 The direction a bullet is going. More...

Typedef Documentation

typedef struct _tank_bullet tank_bullet_t

Definition at line 65 of file tank_main.c.


Enumeration Type Documentation

anonymous enum

The direction a bullet is going.

Enumerator:
BU_UP 
BU_RIGHT 
BU_DOWN 
BU_LEFT 

Definition at line 68 of file tank_main.c.


Function Documentation

static void bullet_bang ( tank_bullet_t bullet,
int  map_x,
int  map_y 
) [static]

Todo:
Remove bang and program when program stops.

Definition at line 366 of file tank_main.c.

static void bullet_go_out_map ( event_t event,
void *  arg 
) [static]

Definition at line 346 of file tank_main.c.

static void bullet_hit_chk ( const mb_timeval_t tmo,
const mb_timeval_t now,
void *  arg 
) [static]

To check if a bullet hits walls or tanks.

Todo:
Move tanks into a list.

Definition at line 402 of file tank_main.c.

static void make_bullet_elf_coords ( redraw_man_t rdman,
coord_t **  coord_pos,
coord_t **  coord_rot,
coord_t **  coord_center 
) [static]

Make coord objects for bullet elfs.

Definition at line 282 of file tank_main.c.

static void tank_bullet_free ( tank_bullet_t bullet  )  [static]

Definition at line 341 of file tank_main.c.

static tank_bullet_t* tank_bullet_new ( redraw_man_t rdman,
int  map_x,
int  map_y,
int  direction 
) [static]

Definition at line 302 of file tank_main.c.

static void tank_fire_bullet ( tank_rt_t tank_rt,
tank_t tank 
) [static]

To fire a bullet for a tank.

Todo:
Simplify the procdure of using observer pattern.

Definition at line 482 of file tank_main.c.

SourceForge.net Logo