def __init__(self, title): super(NetworkGameMenu, self).__init__(title) self.player_name = config.get("main", "playername") self.host = config.get("network", "server") self.port = int(config.get("network", "port")) self.deckfile = config.get("main", "deckfile") self.avatar = config.get("main", "avatar") self.flashing = False
def __init__(self): super(ReloadSolitaireGameMenu, self).__init__('Reload Solitaire Game') self.replay_file = config.get("general", "replay") items = [] items.append(MenuItem('Reload', self.on_reload)) items.append(EntryMenuItem('Replay File:', self.on_replayfile, self.replay_file)) items.append(MenuItem('Back', self.on_quit)) self.create_menu(items)
def __init__(self): super(ReloadSolitaireGameMenu, self).__init__('Reload Solitaire Game') self.replay_file = config.get("general", "replay") items = [] items.append(MenuItem('Reload', self.on_reload)) items.append( EntryMenuItem('Replay File:', self.on_replayfile, self.replay_file)) items.append(MenuItem('Back', self.on_quit)) self.create_menu(items)
def __init__(self): super(SolitaireGameMenu, self).__init__('Solitaire Game') self.p1_name = config.get("main", "playername") self.p2_name = config.get("solitaire", "playername") self.p1_deckfile = config.get("main", "deckfile") self.p2_deckfile = config.get("solitaire", "deckfile") self.p1_avatar = config.get("main", "avatar") self.p2_avatar = config.get("solitaire", "avatar") items = [] items.append(MenuItem('Start', self.on_start)) items.append( EntryMenuItem('Player 1 Name:', lambda v: self.on_name(1, v), self.p1_name)) items.append( EntryMenuItem('Player 1 Deck file:', lambda v: self.on_deckfile(1, v), self.p1_deckfile)) items.append( EntryMenuItem('Player 1 Avatar:', lambda v: self.on_avatar(1, v), self.p1_avatar)) items.append( EntryMenuItem('Player 2 Name:', lambda v: self.on_name(2, v), self.p2_name)) items.append( EntryMenuItem('Player 2 Deck file:', lambda v: self.on_deckfile(2, v), self.p2_deckfile)) items.append( EntryMenuItem('Player 2 Avatar:', lambda v: self.on_avatar(2, v), self.p2_avatar)) items.append(MenuItem('Back', self.on_quit)) self.create_menu(items)
def __init__(self): super(SolitaireGameMenu, self).__init__('Solitaire Game') self.p1_name = config.get("main", "playername") self.p2_name = config.get("solitaire", "playername") self.p1_deckfile = config.get("main", "deckfile") self.p2_deckfile = config.get("solitaire", "deckfile") self.p1_avatar = config.get("main", "avatar") self.p2_avatar = config.get("solitaire", "avatar") items = [] items.append(MenuItem('Start', self.on_start)) items.append(EntryMenuItem('Player 1 Name:', lambda v: self.on_name(1, v), self.p1_name)) items.append(EntryMenuItem('Player 1 Deck file:', lambda v: self.on_deckfile(1, v), self.p1_deckfile)) items.append(EntryMenuItem('Player 1 Avatar:', lambda v: self.on_avatar(1, v), self.p1_avatar)) items.append(EntryMenuItem('Player 2 Name:', lambda v: self.on_name(2, v), self.p2_name)) items.append(EntryMenuItem('Player 2 Deck file:', lambda v: self.on_deckfile(2, v), self.p2_deckfile)) items.append(EntryMenuItem('Player 2 Avatar:', lambda v: self.on_avatar(2, v), self.p2_avatar)) items.append(MenuItem('Back', self.on_quit)) self.create_menu(items)
from pyglet import media, resource import GUIEvent from engine import GameEvent from engine.pydispatch import dispatcher from resources import config resource.path.append("./data/soundfx") resource.reindex() music_volume = config.getfloat("music", "volume") sound_volume = config.getfloat("sound", "volume") toggle_fx = config.getboolean("sound", "enabled") toggle_music = config.getboolean("music", "enabled") background_file = config.get("music", "bgm") class SoundEffects(object): def __init__(self): self.sound_on = False self.music_on = False def make_sound(filename): sound = resource.media(filename, streaming=False) def vplay(): player = sound.play() player.volume = sound_volume return player sound.vplay = vplay return sound self.click = make_sound("click.wav")