ich hab jetzt nochmal den Code aus Aum 104 genommen und eine healthbar gemacht
(von rot nach grün)

-> healthbar:



Code:
#include <acknex.h>
#include <default.c>

var players_health = 100;


BMAP* health_pcx = "grnbar.bmp";

PANEL* health_pan =
{
 pos_x = 10;
 pos_y = 20;
 layer = 10;

 window(50, 0, 128, 32, health_pcx, players_health, 0);
 flags = VISIBLE;
}


function health_startup()
{
  while (1)
  {
   if (key_1) players_health += 2 * time_step;
   if (key_2) players_health -= 2 * time_step;

   wait (1);
   }        
}

function main()
{
 level_load(NULL);
 health_startup(); 
}



achtung:
wenn die healthbar kleiner wird gehen die farben ins grüne statt ins rote ich hab die healthbar.bmp schon gespiegelt,gedreht,bearbeitet ect...

und:

wenn ich den wert auf 100 setzte wird meine healthbar immer kleiner
wie kann ich das beheben ?

Last edited by ratz; 01/24/12 21:04.