Health and Ammo
Blitz3D Forums/Blitz3D Beginners Area/Health and Ammo
| ||
I'm making a fighting RPG game and I am wondering how to put little animated health and ammo bars in the game. Such as the ones in modern fighting games. |
| ||
There are lots of different ways of doing a health bar, but this is about as simple as it gets:Graphics 800,600 SetBuffer BackBuffer() Global Health% = 100 While Not KeyDown(1) health = health - 1 If health < 1 Then health = 100 Cls drawhealth() Flip True Wend Function DrawHealth() For X = 1 To health c = 255-((100-x)*2) Color c,c,0 Line x,0,x,31 Next Color 255,255,255 Rect 0,0,100,32,False End Function |
| ||
You can look at the drawimagerect command too. It will allow you to draw to the screen, a user defined section of the image. |