import GUI
Music.PlayFileLoop ("maintheme.mp3")
const screenWidth : int := Config.Display (cdScreenWidth)
const screenHeight : int := Config.Display (cdScreenHeight)
var windowID : int := 0
var helpg := Pic.FileNew ("controls.jpg")
var helpg2 := Pic.FileNew ("keyboard.jpg")
var backg := Pic.FileNew ("Beach.jpg")
var mblt1 := Pic.FileNew ("mblt1.jpg")
var mblt2 := Pic.FileNew ("mblt2.jpg")
var mblt3 := Pic.FileNew ("mblt3.jpg")
var beach := Pic.FileNew ("beach3large.jpg")
var ammo := Pic.FileNew ("ammo.jpg")
var shield := Pic.FileNew ("health.jpg")
var gun2 := Pic.FileNew ("machinegun.jpg")
var gun := Pic.FileNew ("mgun.jpg")
var bullet := Pic.FileNew ("bullet.jpg")
var soldi : array 0 .. 25 of int
soldi (0) := Pic.FileNew ("soldierss.jpg")
var x1, y1, button1 : int := 0
var x2, y2 : int := 0
var x4, y4, x3, y3, button2 : int
Pic.SetTransparentColor (bullet, black)
Pic.SetTransparentColor (gun, 0)
process shot
Music.PlayFile ("machinegun.wav")
end shot
proc cross
drawoval (335, 300, 8, 8, brightgreen)
drawline (327, 300, 343, 300, brightgreen)
drawline (335, 292, 335, 308, brightgreen)
drawdot (335, 300, brightred)
end cross
proc backgrounds
x1 := x1 - 1500
y1 := y1 - 800
Pic.Draw (shield, 20, 500, picMerge)
Pic.Draw (ammo, 20, 20, picMerge)
cross
View.Update
end backgrounds
var ht : int := 75
procedure mblts
loop
delay (100)
Pic.Draw (mblt1, 650, ht, picMerge)
delay (300)
Pic.Draw (mblt2, 685, ht + 25, picMerge)
delay (300)
Pic.Draw (mblt3, 620, ht - 5, picMerge)
delay (150)
View.Update
exit
end loop
end mblts
proc maingame
loop
View.Update
Mouse.Where (x4, y4, button2)
loop
Pic.Draw (beach, -x4 - 300, -y4 - 180, picCopy)
Pic.Draw (gun, 350, -50, picMerge)
exit
end loop
Mouse.Where (x1, y1, button1)
x2 := x2 + 0
y2 := y2 - 1
backgrounds
Pic.Draw (soldi (0), x1 - 1500, y1 - 800, 3)
if button1 = 1 then
loop
fork shot
Pic.Draw (bullet, 350, 200, picMerge)
delay (100)
Pic.Draw (mblt1, 600, 85, picXor)
View.Update
delay (100)
Pic.Draw (mblt2, 635, 110, picXor)
View.Update
delay (100)
Pic.Draw (mblt3, 680, 105, picXor)
View.Update
exit
end loop
else
delay (20)
end if
end loop
end maingame
var x, y, button : int
windowID := Window.Open ("title:Window #" +
intstr (0) + ",graphics:" +
intstr (150) + ";" + intstr (100) +
",position:" + intstr (50) + ";" + intstr (50))
setscreen ("graphics:640;480,offscreenonly,position:center;center")
loop
var quitButton : int := GUI.CreateButton (530, 450, 0, "EXIT GAME", GUI.Quit)
Pic.Draw (backg, 0, 0, 0)
View.Update
loop
Mouse.Where (x, y, button)
if button = 1 and x >= 288 and x <= 353 and y >= 21 and y <= 45 then
cls
var zz : int := 1
for i : 1 .. 100
delay (50)
Draw.FillBox (100, 15, 100 + zz, 25, 54)
Draw.Box (100, 15, 200, 25, 1)
zz := zz + 1
locate (23, 13)
View.Update
put "Loading... ", zz, "%" ..
end for
locate (23, 13)
put "Done Loading! " ..
View.Update
delay (500)
colorback (white)
delay (300)
Music.PlayFileStop
cls
View.Set ("graphics:max;max,position:center;center,offscreenonly,noecho")
Pic.Draw (beach, 750, 630, 0)
loop
Mouse.Where (x1, y1, button1)
maingame
delay (20)
View.Update
end loop
exit
elsif button = 1 and x >= 424 and x <= 483 and y >= 22 and y <= 43
then
Pic.Draw (helpg, 0, 0, 0)
View.Update
loop
loop
Mouse.Where (x, y, button)
if button = 1 and x >= 458 and y >= 55 and x <= 516 and y <= 76
then
Pic.Draw (helpg2, 0, 0, 0)
View.Update
loop
Mouse.Where (x, y, button)
if button = 1 and x >= 106 and y >= 55 and y <= 77 and x <= 163
then
Pic.Draw (helpg, 0, 0, 0)
View.Update
exit
end if
end loop
elsif button = 1 and x >= 548 and x <= 605 and y >= 455 and y <= 480
then
exit
elsif button = 1 and x >= 106 and y >= 55 and y <= 77 and x <= 163
then
Pic.Draw (backg, 0, 0, 0)
View.Update
exit
end if
exit when button = 1 and x >= 106 and y >= 55 and y <= 77 and x <= 163
end loop
Pic.Draw (backg, 0, 0, 0)
exit
end loop
View.Update
elsif button = 1 and x >= 548 and x <= 605 and y >= 455 and y <= 480
then
exit
end if
end loop
exit
end loop
loop
exit when GUI.ProcessEvent
end loop
if windowID not= 0 then
GUI.CloseWindow (windowID)
end if
GUI.CloseWindow (windowID)
|