예제 #1
0
파일: menu.py 프로젝트: trunghuynh/incantus
 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
예제 #2
0
파일: menu.py 프로젝트: trunghuynh/incantus
 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
예제 #3
0
파일: menu.py 프로젝트: trunghuynh/incantus
 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)
예제 #4
0
파일: menu.py 프로젝트: trunghuynh/incantus
 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)
예제 #5
0
파일: menu.py 프로젝트: trunghuynh/incantus
 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)
예제 #6
0
파일: menu.py 프로젝트: trunghuynh/incantus
 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)
예제 #7
0
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")