setscreen ("graphics:200;100,nobuttonbar,position:center;center,title:Pick Level")
colorback (black)
cls
color (yellow)
put " Choose a Level [1-4]."
color (white)
put " 1 - Inferno"
put " 2 - Militia"
put " 3 - Assault"
put " 4 - Italy"
var mc : int
locate (6, 13)
color (yellow)
get mc
setscreen ("graphics:500;300,nobuttonbar,position:center;center,offscreenonly,title:TMaCz Productions Presents. . .")
colorback (white)
var mapsize : int := 600
var mx, my, mz : int := 50
var ammo : int := 99
var reloads : int := 999
var dif : int := 5
var crosshair : int := 12
var bsavex, bsavey : array 1 .. 99 of int
var bulletx, bullety, shake : int := 0
var font : int := Font.New ("BankGothic Md BT:14:bold")
var mapx, mapx2, mapy, mapy2, gun, guny, gunx : int := 0
guny := -20
gunx := 180
mapx2 := mapsize
mapy := -25
mapy2 := -25
gun := 1
var shot : int := 0
var spark : array 1 .. 3 of int
var guns : array 1 .. 4 of int
var key : array char of boolean
var shoot : int := 0
forward proc fire
proc refresh
cls
drawfillbox (mapx, mapy, mapx + mapsize, maxy, 10)
drawfillbox (mapx2, mapy2, mapx2 + mapsize, maxy, brightblue)
drawline (maxx div 2 - 23 - shake, my, maxx div 2 - 27 - shake, my, crosshair)
drawline (maxx div 2 - 17 + shake, my, maxx div 2 - 13 + shake, my, crosshair)
drawline (maxx div 2 - 20, my + shake + 3, maxx div 2 - 20, my + 7 + shake, crosshair)
drawline (maxx div 2 - 20, my - shake - 3, maxx div 2 - 20, my - 7 - shake, crosshair)
guny := my div 5 - 60
if my > maxy then
guny := 0
elsif my < 0 then
guny := -60
end if
if shot > 0 then
% Pic.Draw (spark (shot), gunx + 40, 80 + guny, picMerge)
end if
%if mz = 1 and ammo > 0 then
% drawfilloval (bulletx, bullety, 1, 1, black)
%end if
if 99 - ammo > 0 then
for i : 1 .. 99 - ammo
drawfilloval (bsavex (i), bsavey (i), 1, 1, black)
end for
end if
drawfillbox (gunx, guny + 10, gunx + 15, guny + 40, black)
Font.Draw (intstr (ammo), 400, 5, font, 67)
Font.Draw ("|", 435, 5, font, 67)
Font.Draw (intstr (reloads), 445, 5, font, 67)
View.Update
delay (0)
end refresh
body proc fire
gunx += 2
guny -= 1
shot := 1
refresh
gunx -= 3
guny += 2
shot := 3
refresh
gunx += 1
guny -= 1
shot := 2
refresh
end fire
loop
Input.KeyDown (key)
mousewhere (mx, my, mz)
if mz = 1 and ammo > 0 then
dif := 5
ammo -= 1
randint (bulletx, maxx div 2 - 20 - shake, maxx div 2 - 20 + shake)
randint (bullety, my - shake, my + shake)
if 99 - ammo > 0 then
bsavex (99 - ammo) := bulletx
bsavey (99 - ammo) := bullety
end if
shake += 1
fire
else
shake := 0
dif := 5
shot := 0
refresh
end if
if key ('a') then
mapx += dif
mapx2 += dif
if 99 - ammo > 0 then
for i : 1 .. 99 - ammo
bsavex (99 - ammo) += dif
end for
end if
if mapx >= maxx then
mapx := mapx2 - mapsize
elsif mapx2 >= maxx then
mapx2 := mapx - mapsize
end if
elsif key ('d') then
mapx -= dif
mapx2 -= dif
if 99 - ammo > 0 then
for i : 1 .. 99 - ammo
bsavex (99 - ammo) -= dif
end for
end if
if mapx + mapsize <= maxx - mapsize then
mapx := maxx - dif
elsif mapx2 + mapsize <= maxx - mapsize then
mapx2 := maxx - dif
end if
end if
if key (KEY_CTRL) or key (KEY_SHIFT) then
mapy := 0
mapy2 := 0
elsif key (' ') then
mapy := -50
mapy2 := -50
else
mapy := -25
mapy2 := -25
end if
if key ('r') and reloads - 99 > 0 then
reloads -= 99 - ammo
ammo := 99
refresh
delay (100)
elsif key ('r') and reloads - 99 < 0 and reloads > 0 then
ammo := reloads
reloads := 0
end if
end loop
/* r = reload, wasd to move, space = stand high, ctrl or shift to crouch, and mouse
|