Ooops
November 28, 2020, 11:11:51 AM

Author Topic: [bb] Energy / Health / Hitpoint Bar by Nebula [ 1+ years ago ]  (Read 376 times)

Offline BlitzBot

  • Jr. Member
  • **
  • Posts: 1
Title : Energy / Health / Hitpoint Bar
Author : Nebula
Posted : 1+ years ago

Description : A function that will display information based on the input numbers.

Loading ..
Hitpoints ..
Health ...
Energy ..
Magic ...
Stanima ...
ect...


Code :
Code: BlitzBasic
  1. Graphics 640,480,16,2
  2. SetBuffer BackBuffer()
  3. ;
  4. hp = 100
  5. While KeyDown(1) = False
  6.         Cls
  7.         energybar(100,100,123,10,hp,100)
  8.         If hp>0 Then hp = hp - 1 Else Text 0,0,"Exit (esc)"
  9.         Flip
  10. Wend
  11. ;
  12. Function Energybar(x,y,width,height,hitpoints,hitpoints_total)
  13.         width = hitpoints / Float(hitpoints_total) * width
  14.         Rect x,y,width,height
  15. End Function
  16. ;


Comments :


thelizardking(Posted 1+ years ago)

 nice


 

SimplePortal 2.3.6 © 2008-2014, SimplePortal