954,535 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Allegro gaming - 3 errors

I'm working on an animated sprite program.
It animates an asteroid sprite and bounces the asteroid around the screen.

When I compile, I am having trouble with 4 particular lines.
I am getting the same three errors for each of the 4 lines.

These are the errors (obviously for line 30):
30 expected `)' before ';' token
30 expected primary-expression before ')' token
30 expected `;' before ')' token

The following are the 4 lines that are giving the problem:

rectfill(dest, spr->x, spr->y, spr->x + spr->width, spr->y + spr->height, BLACK);

textout_ex(screen, font, "SpriteGrabber Program (ESC to quit)", 0, 0, WHITE, 0);

textprintf_ex(screen, font, 0, 20, WHITE, 0, "x,y,xspeed,yspeed: %2d,%2d,%2d,%2d", asteroid->x, asteroid->y, asteroid->xspeed, asteroid->yspeed);

textprintf_ex(screen, font, 0, 30, WHITE, 0, "xcount,ycount,framecount,animdir: %2d, %2d, %2d, %2d", asteroid->xcount, asteroid->ycount, asteroid->framecount, asteroid->animdir);

If I //comment out these 4 lines, the program will run just fine. However, the asteroid will leave a trail, because one of the particular 4 problem lines is the "erasesprite" method which should clear the sprite's previous position.

I look at the problem lines over and over, very carefully, but I'm not seeing the problem.
I'm sure it is something very basic and simple, but I'm sick of staring at it and not figuring it out!

Any help is appreciated!

nola_Coder
Light Poster
49 posts since Oct 2009
Reputation Points: 10
Solved Threads: 0
 

My guess is your #define WHITE
has a ; in it.

Salem
Posting Sage
Team Colleague
11,531 posts since Dec 2005
Reputation Points: 5,862
Solved Threads: 953
 
My guess is your #define WHITE has a ; in it.

Excellent! Thank you!

I'm pretty new to this whole thing...so I appreciate the help.
What info gave it away to you?

nola_Coder
Light Poster
49 posts since Oct 2009
Reputation Points: 10
Solved Threads: 0
 

The error messages ;)

Salem
Posting Sage
Team Colleague
11,531 posts since Dec 2005
Reputation Points: 5,862
Solved Threads: 953
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: