Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / health bar

Author
Message
gothboy 101
20
Years of Service
User Offline
Joined: 31st May 2004
Location: Watonga, ok, usa
Posted: 29th Jul 2004 07:27
someone please help me it wont past image 1. just incase you were wondering its a health bar

max = 10000
current = 10000
load image \"meter.bmp\",1
paste image 1,40,110
DO
cls
drawHealthBar(40,465,110,3,current, max)
sync
LOOP


function drawHealthBar(X, Y, LOB, WOB, CHP, MHP)
REM X = X coordinate to position health bar at
REM Y = Y coordinate to position health bar at
REM LOB = length of health bar
REM WOB = width of health bar
REM CHP = current health points
REM MHP = maximum health points

if CHP < 0 then CHP = 0
if CHP > MHP then CHP = MHP

percent = (CHP*LOB)/MHP

ink rgb(0,0,0), 0
box X, Y, X+LOB, Y
ink rgb(255,0,0), 0
box X, Y, X+percent, Y+WOB

endfunction

Chaos Games
ToXic
22
Years of Service
User Offline
Joined: 8th Sep 2002
Location: Australia
Posted: 29th Jul 2004 07:38
Move your paste image command into your loop under the cls command.

ToXic.
gothboy 101
20
Years of Service
User Offline
Joined: 31st May 2004
Location: Watonga, ok, usa
Posted: 29th Jul 2004 07:49
thanks

Chaos Games

Login to post a reply

Server time is: 2024-09-22 18:41:05
Your offset time is: 2024-09-22 18:41:05