Page 1 of 1

Health Bar Problem

PostPosted: Wed Sep 15, 2010 4:36 pm
by PWNED
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??

Re: Health Bar Problem

PostPosted: Wed Sep 15, 2010 7:07 pm
by Game A Gogo
you forgot a "}" at the very end and there is no ";" after the for() statement

Re: Health Bar Problem

PostPosted: Wed Sep 15, 2010 7:10 pm
by PWNED
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

Re: Health Bar Problem

PostPosted: Wed Sep 15, 2010 9:29 pm
by skydereign
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);
}