View.Set ("offscreenonly")
var x, y, button, bulletsleft : int := 0
bulletsleft := 8
loop
%Bullets Left- Shown at the Top
locate (1, 1)
put "There are ", bulletsleft, " bullets left in the Clip"
%Crosshair
drawfillbox (x - 15, y - 1, x + 15, y + 1, white)
drawfillbox (x - 1, y - 15, x + 1, y + 15, white)
Mouse.Where (x, y, button)
if button = 1 and bulletsleft > 0 then
bulletsleft := bulletsleft - 1
Music.PlayFile ("gunshot.wav")
else
%notshooting
drawfillbox (x - 15, y - 1, x + 15, y + 1, brightblue)
drawfillbox (x - 1, y - 15, x + 1, y + 15, brightblue)
View.Update
delay (10)
end if
if bulletsleft <= 0 then
bulletsleft := 0
end if
end loop
|