expected a declaration
well I keep on getting the error "expected a declaration"
on my bracket
now I really don't see whats so wrong with it.
I added in my other class in case.
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 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81
|
#include <allegro5\allegro.h>
#include <allegro5\allegro_primitives.h>
#include "objects.h"
//globals===================================
const int WIDTH = 800;
const int HEIGHT = 400;
//prototypes
void InitShip(SpaceShip &ship);
void DrawShip(SpaceShip &ship);
int main(void)
{
//primitive varibles
bool done = false;
//object varibles
SpaceShip ship;
//ALLEGRO varibles
ALLEGRO_DISPLAY *display = NULL;
//initalization functions
if(!al_init()) //LOAD
return -1;
display = al_create_display(WIDTH, HEIGHT); //CREATE DISPLAY
if(!display) //TEST DISPLAY
return -1;
al_init_primitives_addon();
InitShip(ship);
while(!done)
{
DrawShip(ship);
al_flip_display();
al_clear_to_color(al_map_rgb(0, 0, 0));
}
al_destroy_display(display);
return 0;
}
void InitShip(SpaceShip &ship)
{
ship.x = 20;
ship.y = HEIGHT / 2;
ship.ID = PLAYER;
ship.lives = 3;
ship.speed = 7;
ship.boundx = 6;
ship.boundy = 7;
ship.score = 0;
}
void DrawShip(SpaceShip &ship);
{
al_draw_filled_rectangle(ship.x, ship.y - 12, ship.x + 10, ship.y - 17, al_map_rgb(250, 250, 250));
}
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
|
enum IDS{PLAYER, BULLET, ENEMY};
//PLayer
struct SpaceShip
{
int ID;
int x;
int y;
int lives;
int speed;
int boundx;
int boundy;
int score;
};
|
well I keep on getting the error "expected a declaration"
on my bracket |
On what bracket? Why are you not giving us complete information?
Last edited on
sorry
on line 74
remove the semi-colon from line 73..
Topic archived. No new replies allowed.