Overflown/gamedata/scenes.py

42 lines
1.6 KiB
Python
Raw Normal View History

2021-06-25 14:42:35 +02:00
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
2021-06-25 16:13:52 +02:00
from gamedata.objects.combat.player import Player
2021-08-08 19:55:21 +02:00
from gamedata.objects.combat.manager import FightManager
from gamedata.objects.combat.hitbox import Hitbox
2021-06-25 16:13:52 +02:00
from gamedata.objects.combat.tileset import TilesetRenderer
2021-06-25 14:42:35 +02:00
def main(game):
2021-07-02 21:06:34 +02:00
game.scaleCamera()
2021-06-25 14:42:35 +02:00
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)
2021-06-25 16:13:52 +02:00
def fight(game):
2021-07-02 21:06:34 +02:00
game.scaleCamera(416,234)
2021-06-25 16:13:52 +02:00
game.gameloop.reinit()
mapname = game.lib.choice(list(game.levels_lib.keys()))
2021-08-08 19:55:21 +02:00
manager = FightManager(game)
game.gameloop.summon(manager)
tileset = TilesetRenderer(0,0,game,mapname)
2021-06-25 16:13:52 +02:00
game.gameloop.summon(tileset)
2021-08-08 19:55:21 +02:00
box = Hitbox(100,80,game)
game.gameloop.summon(box)
2021-07-03 00:26:02 +02:00
p1 = Player(game)
game.gameloop.summon(p1)
2021-06-25 16:13:52 +02:00
2021-06-25 14:42:35 +02:00
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)