def __init__(self): self.debug = False ShowBase.__init__(self) self.accept("escape",sys.exit) # the dt should depend on the framerate self.dt = 0.25 """try: self.database = Database() self.ranking = self.database.getRankingFromDatabase() except: pass""" self.musicManager.setConcurrentSoundLimit(2) #initiate game state self.state = 'Menu' self.terrain = Terrain(1024) """try: self.classement = Classement(self.ranking) self.classement.hideMenu() except: pass""" self.menu = Menu() self.loadStartMenu() if(self.debug == False): self.disableMouse()
def __init__(self): self.current_difficulty = 1 self.max_difficulty = 10 self.levels = [Level1, Level2, Level3, Level4, Level5] self.max_level = len(self.levels) self.current_level = Level1 adapter.init() adapter.set_screen(rgb=theme.BACKGROUND) screen_size = adapter.get_screen_size() self.menu = Menu( screen_size.current_w, screen_size.current_h, self.new_game, self.change_level, self.change_difficulty, self.exit ) self.countdown_event = None self.countdown_surf = None
if pos_y > map_height: pos_y = map_height try: # init window pygame.init() font = pygame.font.SysFont("consolas", 10) clock = pygame.time.Clock() window = pygame.display.set_mode((WINDOW_WIDTH, WINDOW_HEIGHT)) window.fill((255, 255, 255)) window.blit(font.render("Loading...", 1, (0, 0, 0)), (WINDOW_WIDTH / 2 - 10, WINDOW_HEIGHT / 2)) rank = Rank(window, WINDOW_WIDTH - 150, 0) # Menu rendering menu = Menu(window, WINDOW_WIDTH, WINDOW_HEIGHT) nick_name, element, ip, port = menu.display() port = int(port) # connect and get fits data conn = client.Client(ip, port) # data taking from start screen later map_width, map_height, player_id, pos_x, pos_y = conn.connect(nick_name, element) player_id = str(player_id) real_r = 0 SCALE = WINDOW_HEIGHT / map_height end_game = EndGame(window, WINDOW_WIDTH, WINDOW_HEIGHT) play_flag = True while True: clock.tick(FPS)
import tkinter as tk from pathlib import Path import utils from config import Config from gui.analysis import Analysis from gui.menu import Menu from gui.styles import configure_styles if __name__ == "__main__": root = tk.Tk() root.title("Spotify Analyzer") root.iconbitmap(Path("resources") / "icon.ico") configure_styles(root) config = Config.load("config.toml") if config.enable_logs: utils.configure_logger("analyzer", "logs.txt") analysis = Analysis(root, config=config) analysis.gui.pack(expand=True, fill=tk.BOTH, padx=10, pady=10) menu = Menu(root, on_load=analysis.on_load) root.config(menu=menu) root.mainloop()
def __init__(self): ShowBase.__init__(self) from gui.menu import Menu self.m = Menu()