1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
|
struct Enemy
{
double x;
int y;
int speedX;
int speedY;
int points;
int image;
};
struct User
{
double x;
int y;
int speedX;
int speedY;
int image;
};
void MoveEnemy(Enemy &e);
void MoveUserShip(User &s);
bool redraw, move_down = false, move_up = false, move_left = false, move_right = false,
shoot_space = false, start_enter = false, enemy_hit = false, enemy_shoota= false ,enemy_shoot2= false,enemy_shoot3= false,enemy_shoot4= false,enemy_shoot5= false,enemy_shoot6= false,enemy_shoot7= false;
int main(int argc, char **argv)
{
ALLEGRO_DISPLAY * display = NULL;
ALLEGRO_BITMAP * SpriteSheet = NULL;
ALLEGRO_EVENT_QUEUE * EvQue = NULL;
ALLEGRO_EVENT Event;
ALLEGRO_TIMER * Timer = NULL;
User ship = {200, 300, 1, -1, 1};
User bullet;
User bulleta;
User bulletb;
User enemy_bullet;
Enemy a = {50, 50, 1, -1, 1};
Enemy b = {150, 50, 1, -1, 1};
Enemy c = {250, 50, 1, -1, 1};
Enemy d = {350, 50, 1, -1, 1};
Enemy r1 = {100, 75, 1, -1,1};
Enemy r2 = {200, 75,1 ,-1,1};
Enemy r3 = {300, 75, 1, -1,1};
|