Overflown/gamedata/scenes.py

51 lines
1.9 KiB
Python

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.player import Player
from gamedata.objects.ingame.manager import FightManager
from gamedata.objects.ingame.hitbox import Hitbox
from gamedata.objects.ingame.tileset import TilesetRenderer
from gamedata.objects.ingame.water import Water
from gamedata.objects.results import Results
def main(game):
game.scaleCamera()
game.gameloop.reinit() # Je réinitialis la boucle
bg = MenuBackground(game)
menu = MainMenu(game.DISPLAY_WIDTH/4,round(game.DISPLAY_HEIGHT*3/8),game,game.DISPLAY_WIDTH//2,game.DISPLAY_HEIGHT//2)
game.gameloop.summon(bg)
game.gameloop.summon(menu)
def ingame(game,level="Level 2"):
game.scaleCamera(416,234)
game.globals["camerax"] = 0
game.globals["cameray"] = 0
game.gameloop.reinit()
tileset = TilesetRenderer(0,0,game,level)
game.gameloop.summon(tileset)
water = Water(game)
game.gameloop.summon(water)
p1 = Player(game)
game.gameloop.summon(p1)
def overworld(game):
game.scaleCamera(416,234)
game.globals["camerax"] = 0
game.globals["cameray"] = 0
game.gameloop.reinit()
tileset = TilesetRenderer(0,0,game,"Overworld")
game.gameloop.summon(tileset)
def options(game):
game.gameloop.reinit()
game.globals["camerax"] = 0
game.globals["cameray"] = 0
s = BGMSlider(40,40,game,400,40)
s2 = SFXSlider(40,100,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)