here ya go.
sync on
type charHealth
x
y
hp
mp
endtype
dim char(10) as charHealth
for t=1 to 10
char(t).x = rnd(540)
char(t).y = rnd(460)
char(t).hp = rnd(100)
char(t).mp = 100
next t
DO
for t=1 to 10
drawHealthBar(char(t).x,char(t).y,100,10,char(t).hp, char(t).mp)
next t
sync
LOOP
function drawHealthBar(X, Y, LOB, WOB, CHP, MHP)
REM X = X coordinate to position health bar at
REM Y = Y coordinate to position health bar at
REM LOB = length of health bar
REM WOB = width of health bar
REM CHP = current health points
REM MHP = maximum health points
if CHP < 0 then CHP = 0
if CHP > MHP then CHP = MHP
percent = (CHP*LOB)/MHP
ink rgb(100,100,100), 0
box X, Y, X+LOB, Y+WOB
ink rgb(255,0,0), 0
box X, Y, X+percent, Y+WOB
endfunction
"eureka" - Archimedes