I need help with my HP bar
Posted: Sat Jul 23, 2016 6:11 am
So I tried to make an HP bar. If I try to update it I must use CLS but I don't want the whole screeen to get cleared.
Is there any way to fix this or clear only a part of the screen?
Is there any way to fix this or clear only a part of the screen?
Code: Select all
SCREEN _NEWIMAGE(800, 600, 32)
white& = _RGB(255, 255, 255)
green& = _RGB(0, 255, 0)
fhp = 100
hp = fhp
DO
REM Health Bar
'outter line
ol_x = 797 - fhp
LINE (ol_x, 0)-(799, 17), white&, B
'hp
hp_x = ol_x + 1
hp_x1 = hp_x + hp
LINE (hp_x, 1)-(hp_x1, 16), green&, BF
_DELAY 1
hp = hp - 10
CLS
LOOP UNTIL INKEY$ = CHR$(27) OR hp = 0