So I have a main level and a Boss Battle level each in its own region. My main level has a player health bar that works great. My Boss level has a player bar and Boss bar,
my boss bar registers damage fine but my player bar does not. I scripted like this:
//main player
erase(0, 0, 0, 1);
for (i=0;i<maxhp;i++)
{
setpen(180, 0, 0, 0, 1);
moveto(i, 0);
lineto(i, height-1);
}
for (i2=0;i2<hp;i2++)
{
setpen(0, 0, 255, 0, 1);
moveto(i2, 0);
lineto(i2, height-1);
}
//Player in Boss level
erase(0, 0, 0, 1);
for (i=0;i<maxhp1;i++)
{
setpen(180, 0, 0, 0, 1);
moveto(i, 0);
lineto(i, height-1);
}
for (i2=0;i2<hp1;i2++)
{
setpen(0, 0, 255, 0, 1);
moveto(i2, 0);
lineto(i2, height-1);
}
//Boss enemy
erase(0, 0, 0, 1);
for (i=0;i<bossmaxhp;i++)
{
setpen(180, 0, 0, 0, 1);
moveto(i, 0);
lineto(i, height-1);
}
for (i2=0;i2<bosshp;i2++)
{
setpen(0, 0, 255, 0, 1);
moveto(i2, 0);
lineto(i2, height-1);
}
I have checked over and over my scripts in my player and enemy collision,draw,create scripts and they look fine.
I have the hp,hp1,maxhp,maxhp1,bosshp and bossmaxhp set in global variables...so I dont know what to look for next?
Is it possible to have two working health bars on one level?