/*.$file${.::game.h} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/ /* * Model: game.qm * File: ${.::game.h} * * This code has been generated by QM 4.6.0 . * DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost. * * This program is open source software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as published * by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. */ /*.$endhead${.::game.h} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/ #ifndef GAME_H #define GAME_H enum GameSignals { /* signals used in the game */ TIME_TICK_SIG = Q_USER_SIG, /* published from tick ISR */ PLAYER_TRIGGER_SIG, /* posted by Player (ISR) to trigger the Missile */ PLAYER_QUIT_SIG, /* posted by Player (ISR) to quit the game */ GAME_OVER_SIG, /* posted by Ship when it finishes exploding */ PLAYER_SHIP_MOVE_SIG, /* posted by Player (ISR) to the Ship to move it */ TAKE_OFF_SIG, /* from Tunnel to Ship to grant permission to take off */ HIT_WALL_SIG, /* from Tunnel to Ship when Ship hits the wall */ HIT_MINE_SIG, /* from Mine to Ship or Missile when it hits the mine */ SHIP_IMG_SIG, /* from Ship to the Tunnel to draw and check for hits */ MISSILE_IMG_SIG, /* from Missile the Tunnel to draw and check for hits */ MINE_IMG_SIG, /* posted by Mine to the Tunnel to draw the mine */ MISSILE_FIRE_SIG, /* posted by Ship to the Missile to fire */ DESTROYED_MINE_SIG, /* from Missile to Ship when Missile destroyed Mine */ EXPLOSION_SIG, /* from any exploding object to render the explosion */ MINE_PLANT_SIG, /* from Tunnel to the Mine to plant it */ MINE_DISABLED_SIG,/* from Mine to Tunnel when it becomes disabled */ MINE_RECYCLE_SIG, /* posted by Tunnel to Mine to recycle the mine */ SCORE_SIG /* from Ship to Tunnel to adjust game level based on score */ }; /* active objects ..........................................................*/ extern struct Tunnel AO_Tunnel; extern struct Ship AO_Ship; extern struct Missile AO_Missile; /*.$declare${AOs::Tunnel_ctor} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/ /*.${AOs::Tunnel_ctor} .....................................................*/ void Tunnel_ctor(void); /*.$enddecl${AOs::Tunnel_ctor} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/ /*.$declare${AOs::Ship_ctor} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/ /*.${AOs::Ship_ctor} .......................................................*/ void Ship_ctor(void); /*.$enddecl${AOs::Ship_ctor} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/ /*.$declare${AOs::Missile_ctor} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/ /*.${AOs::Missile_ctor} ....................................................*/ void Missile_ctor(uint8_t speed); /*.$enddecl${AOs::Missile_ctor} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/ /* common constants and shared helper functions ............................*/ #define GAME_TUNNEL_WIDTH BSP_SCREEN_WIDTH #define GAME_TUNNEL_HEIGHT (BSP_SCREEN_HEIGHT - 10U) #define GAME_MINES_MAX 5U #define GAME_MINES_DIST_MIN 10U #define GAME_SPEED_X 1U #define GAME_MISSILE_SPEED_X 2U #define GAME_SHIP_X 10U #define GAME_SHIP_Y (GAME_TUNNEL_HEIGHT / 2U) #define GAME_WALLS_GAP_Y 50U #define GAME_WALLS_MIN_GAP_Y 20U enum GameBitmapIds { SHIP_BMP, MISSILE_BMP, MINE1_BMP, MINE2_BMP, MINE2_MISSILE_BMP, EXPLOSION0_BMP, EXPLOSION1_BMP, EXPLOSION2_BMP, EXPLOSION3_BMP, MAX_BMP }; /* instantiation of the Mines orthogonal components */ /*.$declare${AOs::Mine1_ctor} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/ /*.${AOs::Mine1_ctor} ......................................................*/ QHsm * Mine1_ctor(uint8_t id); /*.$enddecl${AOs::Mine1_ctor} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/ /*.$declare${AOs::Mine2_ctor} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/ /*.${AOs::Mine2_ctor} ......................................................*/ QHsm * Mine2_ctor(uint8_t id); /*.$enddecl${AOs::Mine2_ctor} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/ #endif /* GAME_H */