Start game button is working
This commit is contained in:
@ -1,8 +1,9 @@
|
||||
import sys
|
||||
from typing import Any
|
||||
|
||||
from .display.display import Display
|
||||
from .display.mapdisplay import MapDisplay
|
||||
from .display.menudisplay import MenuDisplay
|
||||
from .display.texturepack import TexturePack
|
||||
from .entities.player import Player
|
||||
from .interfaces import Map
|
||||
from .settings import Settings
|
||||
@ -39,7 +40,11 @@ class Game:
|
||||
self.player = Player()
|
||||
self.player.move(1, 6)
|
||||
self.m.add_entity(self.player)
|
||||
self.current_display = MenuDisplay(self, self.main_menu, 0, 0)
|
||||
self.menu_display = MenuDisplay(screen, self.main_menu, 0, 0)
|
||||
self.map_display = MapDisplay(
|
||||
screen, self.m, self.player,
|
||||
TexturePack.get_pack(self.settings.TEXTURE_PACK))
|
||||
self.current_display = self.menu_display
|
||||
|
||||
@staticmethod
|
||||
def load_game(filename: str) -> None:
|
||||
@ -90,6 +95,7 @@ class Game:
|
||||
option = self.main_menu.validate()
|
||||
if option == menus.MainMenuValues.START:
|
||||
self.state = GameMode.PLAY
|
||||
self.current_display = self.map_display
|
||||
elif option == menus.MainMenuValues.SETTINGS:
|
||||
self.state = GameMode.SETTINGS
|
||||
elif option == menus.MainMenuValues.EXIT:
|
||||
|
Reference in New Issue
Block a user