%My Game Menu
import GUI
Pic.ScreenLoad ("C:/game/Map1.jpg", 0, 0, picCopy)
View.Set ("graphics: 975, 800")
View.Set ("nocursor")
var font, font2, font3 : int
var first, second : int % The menus.
var item : array 1 .. 6 of int % The menu items.
var name : array 1 .. 6 of string (20) :=
init ("Quit", "Map", "Player", "Controls", "mapsel", "--") %, "Player select")
%(, "B", "---", "C", "D",
%"Disable B Menu Item", "Enable B Menu Item", "---",
%"Disable Second Menu", "Enable Second Menu")
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
font := Font.New ("Agent Orange:16")
font2 := Font.New ("Times:9")
font3 := Font.New ("Times:14")
procedure HumTank
for i : 1 .. 6
if item (i) = GUI.GetEventWidgetID then
Text.Locate (maxrow, 1)
put name (i) + "s Selected"
%body
drawfillbox (50, 220, 80, 250, 40)
drawbox (50, 220, 80, 250, black)
%turret
drawfillbox (60, 240, 70, 265, 40)
drawbox (60, 230, 70, 265, black)
%body
drawline (50, 240, 60, 250, black)
drawline (50, 230, 60, 220, black)
drawline (70, 220, 80, 230, black)
drawline (80, 240, 70, 250, black)
drawline (60, 240, 50, 240, black)
drawline (60, 230, 50, 230, black)
drawline (60, 230, 60, 220, black)
drawline (70, 230, 70, 220, black)
drawline (70, 230, 80, 230, black)
drawline (70, 240, 80, 240, black)
drawline (60, 240, 65, 230, black)
drawline (70, 240, 65, 230, black)
%var Hu : int := GUI.CreateButtonFull (50, 10, 0, "Humans",
%Humtank, 0, '^D', true)
%var quitBtn : int := GUI.CreateButton (200, 10, 0, "Quit", GUI.Quit)
end if
end for
end HumTank
procedure MenuSelected
for i : 1 .. 6
if item (i) = GUI.GetEventWidgetID then
Text.Locate (maxrow, 1)
put name (i) + " selected option" ..
end if
end for
end MenuSelected
procedure Mapsel
for i : 1 .. 6
if item (i) = GUI.GetEventWidgetID then
put "Map One: Grassland"
%locatexy (100, 330)
Pic.ScreenLoad ("H:/map12.jpg", 0, 0, picCopy)
end if
end for
end Mapsel
procedure Map
for i : 1 .. 6
if item (i) = GUI.GetEventWidgetID then
Text.Locate (maxrow, 1)
put name (i) + "s menu selected" ..
delay (800)
Mapsel
end if
end for
end Map
procedure Playsel
for i : 1 .. 6
if item (i) = GUI.GetEventWidgetID then
cls
%Text.Locate (maxrow, 1)
%put name (i) + " Test " ..
Draw.Text ("Humans", 13, 330, font, 40)
HumTank
drawline (13, 313, 140, 313, black)
end if
end for
end Playsel
procedure Player
for i : 1 .. 6
if item (i) = GUI.GetEventWidgetID then
Text.Locate (maxrow, 1)
put name (i) + "s select menu" ..
delay (800)
cls
Playsel
end if
end for
end Player
%menu 2 items
procedure controls
for i : 1 .. 6
if item (i) = GUI.GetEventWidgetID then
Text.Locate (maxrow, 1)
put name (i) + "s option selected" ..
delay (800)
cls
put "The controls are: "
put ""
put ""
put " Player One"
put " -----------"
put ""
put " Forward : 'W'"
put " Down : 'S'"
put " Left : 'A'"
put " Right : 'D'"
end if
end for
end controls
% Create the menus
first := GUI.CreateMenu ("Game")
item (3) := GUI.CreateMenuItem (name (3), Player)
item (2) := GUI.CreateMenuItem (name (2), Map)
item (1) := GUI.CreateMenuItem (name (1), GUI.Quit)
%item (4) := GUI.CreateMenuItem (name (4), Playsel)
second := GUI.CreateMenu ("Options")
item (4) := GUI.CreateMenuItem (name (4), controls)
loop
exit when GUI.ProcessEvent
end loop
|