Health Bar Problem

Non-platform specific questions.

Health Bar Problem

Postby PWNED » Wed Sep 15, 2010 4:36 pm

Hey Everyone!!

I came across this problem while making a health bar

First Draw Actor Then:

Code: Select all
erase(0, 0, 0, 1);
for (I=0:I<MAX_HP:I++);
{
    setpen(0, 216, 28, 0, 1);
    moveto(I, 0);
    lineto(I, height-1);


then it says

Error line 2: Expected ;
Error line 3: Expected ;
Error line 8: Expected ;

What do I need to do??
PWNED
 
Posts: 16
Joined: Wed Jul 21, 2010 10:17 pm
Score: 0 Give a positive score

Re: Health Bar Problem

Postby Game A Gogo » Wed Sep 15, 2010 7:07 pm

you forgot a "}" at the very end and there is no ";" after the for() statement
Programming games is an art,
    Respect it.
User avatar
Game A Gogo
 
Posts: 3466
Joined: Wed Jun 29, 2005 10:49 pm
Location: French Canada *laughs*
Score: 181 Give a positive score

Re: Health Bar Problem

Postby PWNED » Wed Sep 15, 2010 7:10 pm

Game A Gogo wrote:you forgot a "}" at the very end and there is no ";" after the for() statement


the } Just wasnt copied sry and the ; didnt change anything
PWNED
 
Posts: 16
Joined: Wed Jul 21, 2010 10:17 pm
Score: 0 Give a positive score

Re: Health Bar Problem

Postby skydereign » Wed Sep 15, 2010 9:29 pm

I assume I has been declared, so in the for() they are not : but ;.
Code: Select all
erase(0, 0, 0, 1);
for (I=0;I<MAX_HP;I++)
{
    setpen(0, 216, 28, 0, 1);
    moveto(I, 0);
    lineto(I, height-1);
}
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest