5 Struct GAME_ENV
gullradriel edited this page 2026-10-09 00:55:18 +02:00

GAME_ENV

Module: GAME APPS: game environment management utilities

Game Environment structure.

#include "n_games.h"

Public Attributes

Name
int z
position z
int y
position y
int x
position x
int wait_for_slowing_down_cpu
=0 for doing nothing, =1 if logic is done, = 2 if drawing is done too
ALLEGRO_BITMAP * scrbuf
screen buffer bitmap
int score
Store score value.
int right_attack_pos
right attack position
int right_attack
right attack trigger
int real_framerate
Measured framerate.
int nb_min_particles
minimum number of particles
int loop_time
time between each loop
ALLEGRO_TIMER * logic_timer
logic timer
int logic_time
time before a new logic update is done
int lifes
Remaining lives.
int level
Level number.
int left_attack_pos
left attack position
int left_attack
left attack trigger
N_TIME game_timer
TIMER.
int fade_value
alpha value of black blit ( 20 default )
ALLEGRO_EVENT_QUEUE * event_queue
event queue
ALLEGRO_TIMER * draw_timer
drawing timer
int draw_time
time before updating graphics in usec
ALLEGRO_DISPLAY * display
Allegro5 display.
int LOGIC_RATE
time between two logic frames 20000 default
int GFX_UPDATE_RATE
time between two graphic frames 20000 default
int GFX_CONFIG_MODE
display mode: GFX_WINDOWED, GFX_FULLSCREEN, or GFX_FULLSCREEN_WINDOW
int DONE
loop while DONE != 1
int CPU_MODE
status of the cpu mode , CPU_USE_FULL by default
int BLUR
wanna blur effect ?

Public Attributes Documentation

variable z

int z;

position z

variable y

int y;

position y

variable x

int x;

position x

variable wait_for_slowing_down_cpu

int wait_for_slowing_down_cpu;

=0 for doing nothing, =1 if logic is done, = 2 if drawing is done too

variable scrbuf

ALLEGRO_BITMAP * scrbuf;

screen buffer bitmap

variable score

int score;

Store score value.

variable right_attack_pos

int right_attack_pos;

right attack position

variable right_attack

int right_attack;

right attack trigger

variable real_framerate

int real_framerate;

Measured framerate.

variable nb_min_particles

int nb_min_particles;

minimum number of particles

variable loop_time

int loop_time;

time between each loop

variable logic_timer

ALLEGRO_TIMER * logic_timer;

logic timer

variable logic_time

int logic_time;

time before a new logic update is done

variable lifes

int lifes;

Remaining lives.

variable level

int level;

Level number.

variable left_attack_pos

int left_attack_pos;

left attack position

variable left_attack

int left_attack;

left attack trigger

variable game_timer

N_TIME game_timer;

TIMER.

variable fade_value

int fade_value;

alpha value of black blit ( 20 default )

variable event_queue

ALLEGRO_EVENT_QUEUE * event_queue;

event queue

variable draw_timer

ALLEGRO_TIMER * draw_timer;

drawing timer

variable draw_time

int draw_time;

time before updating graphics in usec

variable display

ALLEGRO_DISPLAY * display;

Allegro5 display.

variable LOGIC_RATE

int LOGIC_RATE;

time between two logic frames 20000 default

variable GFX_UPDATE_RATE

int GFX_UPDATE_RATE;

time between two graphic frames 20000 default

variable GFX_CONFIG_MODE

int GFX_CONFIG_MODE;

display mode: GFX_WINDOWED, GFX_FULLSCREEN, or GFX_FULLSCREEN_WINDOW

variable DONE

int DONE;

loop while DONE != 1

variable CPU_MODE

int CPU_MODE;

status of the cpu mode , CPU_USE_FULL by default

variable BLUR

int BLUR;

wanna blur effect ?

( 0 or 1 )