well I am stuck on media to do for this, but I did manage to make a working Health bar system. I am having trouble making a time bar though; it just wont appear for some reason!
anyway here's the game with the health bars and the messed up time bar
` * Title : Attack the Guy V1.2
` * Author : Dexus 136
` * Date : 3 - 14 - 09
cls : sync on : sync rate 0
`*** Instructions ***
text 50,50,"Welcome"; wait 1000
text 50,70,"You will be fighting!"; wait 1000
text 50,90,"To 'Attack' push the SpaceBar"; wait key
wait 500 ; cls
`First Level Setup
Level = 1
Hitr = 98
Begin:
gosub Innitialize
`*** Main Loop ***
do
gosub Game
if Elife = 0
wait 500
cls
text 50,50,"You Win!"
wait 2000
cls
text 50,50,"Next Level!"
wait 2000
inc Level,1
dec Hitr,2
goto begin
endif
if Time < 0 or Plife = 0
wait 500
cls
text 50,50,"You lost!"
text 50,70,"Thanks for playing"
wait 5000
end
endif
sync: cls
loop
`*** Innitialize ***
Innitialize:
cls
`Readys the player
text 50,50,"GET READY!"
wait 1500
cls
text 50,50,"FIGHT!"
wait 1500
cls
`Time
Time = 1500
left3 = 160
top3 = 93
right3 = (left3+150)
bottom3 = (top3+10)
`Player life
Plife = 100
left1 = 160
top1 = 73
right1 = (left1+100)
bottom1 = (top1+10)
`Enemy life
Elife = 100
left2 = 160
top2 = 53
right2 = (left2+100)
bottom2 = (top2+10)
return
`*** Game ***
Game:
gosub KeyHandler
gosub LevelHandler
gosub TimeHandler
gosub BarHandler
gosub DrawText
return
`*** KeyHandler ***
KeyHandler:
`Checks for Space
if spacekey() = 1
if KeyPress = 0
dec Elife, 1
dec right2, 1
endif
KeyPress = 1
else
KeyPress = 0
endif
return
`*** LevelHandler ***
LevelHandler:
if Level = Level
Eattack = rnd(100)
if Eattack > Hitr
dec Plife, 1
dec right1, 1
endif
endif
return
`*** TimeHandler ***
TimeHandler:
dec Time,1
TimeP = (Time/100)
right3 = (TimeP*10)
`The time bar doesn't appear for reasons unkown
return
`*** BarHandler ***
BarHandler:
`Player
ink rgb(0,255,0),0
box left1, top1, right1, bottom1
`Enemy
ink rgb(255,0,0),0
box left2, top2, right2, bottom2
`Time
ink rgb(0,0,255),0
box left3, top3, right3, bottom3
return
`*** DrawText ***
DrawText:
ink rgb(255,255,255),0
text 50,50,"Enemy Life: " + str$(Elife)
text 50,70,"Your Life: " + str$(Plife)
text 50,90,"Time: " + str$(TimeP)
return
I'll be back on tomorrow. I gotta go to bed.