%Barbarien Bashers
import GUI
View.Set ("graphics:800;600;offscreenonly;nocursor")
var x, y, xc1, yc1, xc2, yc2, xc3, yc3, xc4, yc4, xc5, yc5, xc6, yc6, xc7, yc7, xc8, yc8, xc9, yc9, xc10, yc10, WindowView : int := 0
var fnt1 := Font.New ("Ariel:12x7")
var fnt2 := Font.New ("Ariel:12x7")
var fnt3 := Font.New ("Ariel:12x9")
var fnt4 := Font.New ("Ariel:12x10")
var fnt5 := Font.New ("Ariel:12x11")
var fnt6 := Font.New ("Ariel:12x12")
var fntstrech := 0
var colorText := 160
var Player1 := Pic.FileNew ("Pictures/Player1.jpg")
var Player2 := Pic.FileNew ("Pictures/Player2.jpg")
var drawx := maxx div 100
var drawy := maxy div 100
var chars : array char of boolean
var menumain := 0
procedure Play
menumain := 3
GUI.Quit
end Play
procedure Viewchange
menumain := 3
GUI.Quit
end Viewchange
procedure Back1
menumain := 2
GUI.Quit
end Back1
procedure Sound
menumain := 3
GUI.Quit
end Sound
procedure Option
menumain := 2
GUI.Quit
end Option
procedure Graphics640_400
View.Set ("graphics:640;400;offscreenonly;nocursor")
menumain := 2
GUI.Quit
end Graphics640_400
procedure Graphics800_600
View.Set ("graphics:800;600;offscreenonly;nocursor")
menumain := 2
GUI.Quit
end Graphics800_600
procedure Graphics1024_768
View.Set ("graphics:1024;768;offscreenonly;nocursor")
menumain := 2
GUI.Quit
end Graphics1024_768
procedure WelcomeScreen
loop
Input.KeyDown (chars)
if menumain = 0 then
if chars (KEY_ENTER) then
if menumain = 0 then
delay (250)
menumain := 1
end if
end if
colorback (16)
if fntstrech = 1 then
if colorText > 309 then
fntstrech := 0
end if
colorText += 1
elsif fntstrech = 0 then
if colorText < 171 then
fntstrech := 1
end if
colorText -= 1
end if
Font.Draw ("Press Enter to Start", drawx * 44, drawy * 20, fnt2, colorText div 10)
elsif menumain = 1 then
delay (250)
loop
cls
var PlayBUTTON : int := GUI.CreateButtonFull (maxx div 2 - drawx * 7, drawy * 40, drawx * 14, "Play", Play, 0, '^d', true)
var OptionBUTTON : int := GUI.CreateButtonFull (maxx div 2 - drawx * 7, drawy * 35, drawx * 14, "Options", Option, 0, '^d', true)
exit when GUI.ProcessEvent
View.Update
delay (1)
GUI.Dispose (PlayBUTTON)
GUI.Dispose (OptionBUTTON)
end loop
GUI.ResetQuit
elsif menumain = 2 then
delay (250)
loop
cls
var OptionGraphicsBUTTON : int := GUI.CreateButtonFull (maxx div 2 - drawx * 7, drawy * 40, drawx * 14, "Video", Viewchange, 0, '^d', true)
var OptionSoundBUTTON : int := GUI.CreateButtonFull (maxx div 2 - drawx * 7, drawy * 35, drawx * 14, "Sound", Sound, 0, '^d', true)
var OptionBackBUTTON : int := GUI.CreateButtonFull (maxx div 2 - drawx * 7, drawy * 30, drawx * 14, "Back", Back1, 0, '^d', true)
exit when GUI.ProcessEvent
View.Update
delay (1)
GUI.Dispose (OptionGraphicsBUTTON)
GUI.Dispose (OptionSoundBUTTON)
GUI.Dispose (OptionBackBUTTON)
end loop
GUI.ResetQuit
elsif menumain = 3 then
delay (250)
loop
cls
var OptionGraphicsSet640_400BUTTON : int := GUI.CreateButtonFull (maxx div 2 - drawx * 9, drawy * 40, drawx * 18, "Video(640,400)", Graphics640_400, 0, '^d', true)
var OptionGraphicsSet800_600BUTTON : int := GUI.CreateButtonFull (maxx div 2 - drawx * 9, drawy * 35, drawx * 18, "Video(800,600)", Graphics800_600, 0, '^d', true)
var OptionGraphicsSet1024_768BUTTON : int := GUI.CreateButtonFull (maxx div 2 - drawx * 9, drawy * 30, drawx * 18, "Video(1024,768)", Graphics1024_768, 0, '^d', true)
exit when GUI.ProcessEvent
View.Update
delay (1)
GUI.Dispose (OptionGraphicsSet640_400BUTTON)
GUI.Dispose (OptionGraphicsSet800_600BUTTON)
GUI.Dispose (OptionGraphicsSet1024_768BUTTON)
end loop
GUI.ResetQuit
elsif menumain = 4 then
delay (250)
loop
cls
var OptionSoundOffBUTTON : int := GUI.CreateButtonFull (maxx div 2 - drawx * 9, drawy * 40, drawx * 18, "Sound(OFF)", Graphics640_400, 0, '^d', true)
var OptionSoundOnBUTTON : int := GUI.CreateButtonFull (maxx div 2 - drawx * 9, drawy * 35, drawx * 18, "Sound(ON)", Graphics800_600, 0, '^d', true)
exit when GUI.ProcessEvent
View.Update
delay (1)
GUI.Dispose (OptionSoundOffBUTTON)
GUI.Dispose (OptionSoundOnBUTTON)
end loop
GUI.ResetQuit
end if
View.Update
Time.DelaySinceLast (5)
cls
end loop
end WelcomeScreen
procedure GamePlay
end GamePlay
procedure GameOver
end GameOver
loop
if WindowView = 0 then
WelcomeScreen
elsif WindowView = 1 then
GamePlay
elsif WindowView = 2 then
GameOver
end if
end loop |