sync on
sync rate 30
top:
haelthbarmax#=120
healthbarmin#=5
do
cls
Set cursor 20,100
Print healthbarmax#
ink rgb(255,0,0),0
rem draw a box to the color red
box 0,0,125,25
ink rgb(0,0,255),rgb(0,0,0)
rem draw the actual health bar to the color blue
box healtbarhmin#,5,healthbarmax#,20
rem if you press the leftkey, decrease health
if leftkey()=1 then dec healthbarmax#,1
rem if you press the rightkey, increase health
if rightkey()=1 then inc healthbarmax#,1
rem if you have 5 health left game over, note you can change this to whatever you want
if healthbarmax# = haelthbarmin#
text 20,50,"Game Over"
wait 1000
goto top
endif
rem if you reach max health stop adding
if healthbarmax# > 120
text 20,50,"You Cannot Add Any More Health"
healthbarmax#=120
endif
sync
loop
I added a part that makes it so you can see your amount of health
Enjoy Life while your still alive.
Enjoy a recees anytime!