Code archives/Graphics/Energy / Health / Hitpoint Bar

This code has been declared by its author to be Public Domain code.

Download source code

Energy / Health / Hitpoint Bar by Nebula2006
A function that will display information based on the input numbers.

Loading ..
Hitpoints ..
Health ...
Energy ..
Magic ...
Stanima ...
ect...
Graphics 640,480,16,2
SetBuffer BackBuffer()
;
hp = 100
While KeyDown(1) = False
	Cls
	energybar(100,100,123,10,hp,100)
	If hp>0 Then hp = hp - 1 Else Text 0,0,"Exit (esc)"
	Flip
Wend
;
Function Energybar(x,y,width,height,hitpoints,hitpoints_total)
	width = hitpoints / Float(hitpoints_total) * width
	Rect x,y,width,height
End Function
;

Comments

thelizardking2006
nice


Code Archives Forum