- Code: Select all
int i;
i = 0;
for (i=0; i<=100; i++)
{
setpen(255, 0,255, 0 ,i);
lineto(1000, i);
}
int i;
i = 0;
for (i=0; i<=100; i++)
{
setpen(255, 0,255, 0 ,i);
lineto(1000, i);
}
moveto(0, 0);
lineto(0, 10);
lineto(10, 10);
//set pointer variable
int i;
i = 0;
//Make the whole energy bar black
setpen(0,0,0,0,i);
for (i=0; i<=10; i++)
{
moveto(0,i);
lineto(100, i);
}
//Change energy colour Green = safe Yellow = warning Red = Danger
//Energy is from 0 to 100 at 0 player character is destroyed
setpen(0, 255,0, 0 ,i);
if (player.plr_energy <=50)
setpen(255,252, 0,0 , i);
if (player.plr_energy <=25)
setpen(255,0,0,0,i);
//Draw energy with colour
for (i=0; i<=10; i++)
{
moveto(0,i);
lineto(player.plr_energy, i);
}
Users browsing this forum: No registered users and 1 guest