My entry for the VimJam2 https://justayte.itch.io/pinmik-panik
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

66 lines
2.7 KiB

from gamedata.objects.menu.mainmenu import MainMenu
from gamedata.objects.bg.movingbackground import MovingBackground
from gamedata.objects.bg.menubackground import MenuBackground
from gamedata.objects.menu.optionmenu import OptionMenu
from gamedata.objects.sliders.bgmslider import BGMSlider
from gamedata.objects.sliders.sfxslider import SFXSlider
from gamedata.objects.ingame.lemmings import Lemming
from gamedata.objects.ingame.manager import Manager
from gamedata.objects.gameover import GameOver
from gamedata.objects.ingame.skies import Skies
from gamedata.objects.ingame.clouds import Clouds
from gamedata.objects.resetbutton import Reset
from gamedata.objects.rescalebutton import Rescale
from gamedata.objects.link import Link
def main(game):
game.scaleCamera()
game.gameloop.reinit()
bg = MenuBackground(game)
skies = Skies(game)
# Clouds in the background
clouds = Clouds(game,game.DISPLAY_WIDTH,speed=30,cameraratio=0.05)
cloudsdark = Clouds(game,game.DISPLAY_WIDTH,speed=10,cameraratio=0.02,spritename="cloudsdark.png")
game.gameloop.summon(cloudsdark)
game.gameloop.summon(clouds)
menu = MainMenu(game.DISPLAY_WIDTH/4,round(game.DISPLAY_HEIGHT*3/8),game,game.DISPLAY_WIDTH//2,game.DISPLAY_HEIGHT//2)
spr = game.sprite_lib["jamlogo.png"]
jamicon = Link(0,game.DISPLAY_HEIGHT-spr.get_height(),game,spr,"https://itch.io/jam/vimjam2")
spr = game.sprite_lib["handle.png"]
name = Link(game.DISPLAY_WIDTH-spr.get_width(),game.DISPLAY_HEIGHT-spr.get_height(),game,spr,"https://justayte.itch.io")
game.gameloop.summon(skies)
game.gameloop.summon(bg)
game.gameloop.summon(menu)
game.gameloop.summon(jamicon)
game.gameloop.summon(name)
def ingame(game):
game.gameloop.reinit()
game.globals["camerax"] = 0
game.globals["cameray"] = 0
game.gameloop.summon(Manager(game))
game.sound_lib["bgm/menu.ogg"].stop()
game.sound_lib["bgm/ingame.ogg"].play(-1)
def options(game):
game.gameloop.delname("Button")
game.gameloop.delname("MainMenu")
game.gameloop.delname("Link")
game.globals["camerax"] = 0
game.globals["cameray"] = 0
s = BGMSlider(40,40,game,400,40)
s2 = SFXSlider(40,100,game,400,40)
btn = Rescale(40,160 ,game,400,40)
btn2 = Reset(40,220,game,400,40)
menu = OptionMenu(round(game.DISPLAY_WIDTH/8),round(game.DISPLAY_HEIGHT*9/10),game,round(game.DISPLAY_WIDTH*6/8),round(game.DISPLAY_HEIGHT/10-game.DISPLAY_HEIGHT/30))
game.gameloop.summon(s)
game.gameloop.summon(s2)
game.gameloop.summon(btn)
game.gameloop.summon(btn2)
game.gameloop.summon(menu)
def gameover(game):
game.gameloop.reinit()
go = GameOver(game)
game.gameloop.summon(go)
game.sound_lib["bgm/ingame.ogg"].stop()