View.Set ('offscreenonly')
var x, y, button, bulletsleft : int
bulletsleft := 8
loop
%Bullets Left Shown at Top
locate (1, 1)
put "Bullets Left in the Clip: ", bulletsleft
Mouse.Where (x, y, button)
%CROSSHAIR%
locatexy (maxx div 2, maxy div 2)
%Triple-Thick Horizontal Line
drawline (x - 30, y, x + 30, y, black)
drawline (x - 30, y - 1, x + 30, y - 1, black)
drawline (x - 30, y + 1, x + 30, y + 1, black)
%Triple-Thick Vertical Line
drawline (x, y - 30, x, y + 30, black)
drawline (x - 1, y - 30, x - 1, y + 30, black)
drawline (x + 1, y - 30, x + 1, y + 30, black)
%Clearing Screen of Crosshair
View.Update
cls
%BUTTON-CLICKING%
%Bullets-Left Count
if button = 1 then
bulletsleft := bulletsleft - 1
delay (250)
%Reload Warning
if bulletsleft <= 0 then
bulletsleft := 0
locate (2, 1)
put "Out of Ammo! Press R to reload"
%No Ammo Left sound
sound (80, 40)
end if
%Gunshot Spiral thing
if bulletsleft > 0 and button = 1 then
locatexy (maxx div 2, maxy div 2)
drawoval (x, y, 2, 2, red)
delay (15)
cls
drawoval (x, y, 4, 4, red)
delay (15)
cls
drawoval (x, y, 8, 8, red)
delay (15)
cls
drawoval (x, y, 12, 12, red)
delay (15)
cls
drawoval (x, y, 18, 18, red)
delay (15)
cls
%Gun Shooting Sound
sound (400, 20)
sound (350, 20)
sound (300, 20)
sound (250, 20)
sound (200, 20)
end if
end if
end loop
|