--pge.mp3.play("sfx/bg.mp3")
menu1 = pge.texture.load("gfx/icon_main.png")
bg = pge.texture.load("gfx/bg.png")
bg2 = pge.texture.load("gfx/bg2.png")
barre = pge.texture.load("gfx/bar.png")
banana = pge.texture.load("gfx/banana.png")
--bgwav = pge.wav.load("sfx/bg.wav")
cannon_base = pge.texture.load("gfx/cannon-base.png")
cannon_cannon = pge.texture.load("gfx/cannon-cannon.png")
island = pge.texture.load("gfx/island.png")
palm1 = pge.texture.load("gfx/palm1.png")
palm2 = pge.texture.load("gfx/palm2.png")
plane1 = pge.texture.load("gfx/plane1.png")
plane2 = pge.texture.load("gfx/plane2.png")
plane3 = pge.texture.load("gfx/plane3.png")
plane4 = pge.texture.load("gfx/plane4.png")
sky = pge.texture.load("gfx/sky.png")
water = pge.texture.load("gfx/water.png")
bullet = pge.texture.load("gfx/bullet.png")
bomb = pge.texture.load("gfx/bomb.png")
smoke = pge.texture.load("gfx/smoke.png")
left = pge.texture.load("gfx/left.png")
right = pge.texture.load("gfx/right.png")
tropfen1 = pge.texture.load("gfx/tropfen1.png")
exploision1 = pge.texture.load("gfx/exploision1.png")
exploision2 = pge.texture.load("gfx/exploision2.png")
exploision3 = pge.texture.load("gfx/exploision3.png")
exploision4 = pge.texture.load("gfx/exploision4.png")
shotplane = pge.texture.load("gfx/shotplane.png")
ballon1 = pge.texture.load("gfx/ballon-purple.png")
ballon2 = pge.texture.load("gfx/ballon-red.png")
ballon3 = pge.texture.load("gfx/ballon-yellow.png")
impact20 = pge.font.load("font.ttf", 14)
dofile("game.lua")
dofile("invasion.lua")
--variablen:
menu = 1
rot1 = 0
rot2 = 0
rot3 = 0
banana_rotate = 0
green = pge.gfx.createcolor(0, 255, 0)
black = pge.gfx.createcolor(0, 0, 0)
red = pge.gfx.createcolor(255, 0, 0)
bg_x = 0
curgamemode = "menu"
function draw_background()
bg:activate()
bg:draw(bg_x, 0)
bg2:activate()
bg2:draw(bg_x-480, 0)
bg_x = bg_x + 0.1
menu1:activate()
menu1:draw(0, 44)
banana:activate()
banana:draweasy(400,140,banana_rotate,200)
banana_rotate = banana_rotate + 0.1
if bg_x >= 480 then bg_x = 0 end
end
function draw_menu()
if pge.controls.pressed(PGE_CTRL_UP) then
menu = menu -1
end
if pge.controls.pressed(PGE_CTRL_DOWN) then
menu = menu + 1
end
barre:activate()
barre:draweasy(250, 100, rot1, 255)
barre:draweasy(250, 140, rot2, 255)
barre:draweasy(250, 180, rot3, 255)
barre:draweasy(250, 220, rot3, 255)
impact20:activate();
impact20:print(255,101,green,"D u e l l ")
impact20:print(255,141,green,"I n v a s i o n ")
impact20:print(255,181,green,"O p t i o n e n")
impact20:print(255,221,green,"E n d e")
if menu == 1 then
impact20:print(255,101,red,"D u e l l ")
if pge.controls.pressed(PGE_CTRL_CROSS) then
curgamemode = "duell"
end
end
if menu == 2 then
impact20:print(255,141,red,"I n v a s i o n ")
if pge.controls.pressed(PGE_CTRL_CROSS) then
curgamemode = "invasion"
end
end
if menu == 3 then
impact20:print(255,181,red,"O p t i o n e n ")
end
if menu == 4 then
impact20:print(255,221,red,"E n d e ")
end
end
--bgwav:play()
--mainloop:
while pge.running() do
pge.controls.update()
pge.gfx.startdrawing()
pge.gfx.clearscreen()
pge.controls.update()
--pge.mp3.play("sfx/bg.mp3")
--menü
if curgamemode == "menu" then
draw_background()
draw_menu()
end
if curgamemode == "duell" then
duell()
if pge.controls.pressed(PGE_CTRL_START) then curgamemode = "menu" end
end
if curgamemode == "invasion" then
invasion()
if pge.controls.pressed(PGE_CTRL_START) then curgamemode = "menu" end
end
pge.gfx.enddrawing()
pge.gfx.swapbuffers()
--zur entwicklungshilfe:
--if pge.controls.pressed(PGE_CTRL_START) then
--impact20 = nil
-- dofile("script.lua")
end