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!

Recommended Answers

All 3 Replies

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

commented: Almost as if you use a crystal ball :) +12

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?

The error messages ;)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.