Example #1
0
    def __init__(self):
        super( MainMenu, self).__init__('SNAKER') 

        self.select_sound = soundex.load('move.mp3')

        # you can override the font that will be used for the title and the items
        # you can also override the font size and the colors. see menu.py for
        # more info
        self.font_title['font_name'] = 'Edit Undo Line BRK'
        self.font_title['font_size'] = 72
        self.font_title['color'] = (204,164,164,255)

        self.font_item['font_name'] = 'Edit Undo Line BRK',
        self.font_item['color'] = (32,16,32,255)
        self.font_item['font_size'] = 32
        self.font_item_selected['font_name'] = 'Edit Undo Line BRK'
        self.font_item_selected['color'] = (32,16,32,255)
        self.font_item_selected['font_size'] = 46


        # example: menus can be vertical aligned and horizontal aligned
        self.menu_anchor_y = CENTER
        self.menu_anchor_x = CENTER

        items = []

        items.append( MenuItem('New Game', self.on_new_game) )
        items.append( MenuItem('Options', self.on_options) )
        items.append( MenuItem('Scores', self.on_scores) )
        items.append( MenuItem('Quit', self.on_quit) )

        self.create_menu( items, shake(), shake_back() )
Example #2
0
    def __init__(self):
        super( IntroLayer, self ).__init__()

        w,h = director.get_window_size()
        self.font_title = {}

        # you can override the font that will be used for the title and the items
        self.font_title['font_name'] = FONT_NAME_TITLE
        self.font_title['font_size'] = 26
#        self.font_title['color'] = (204,164,164,255)
        self.font_title['color'] = COLOR_WHITE
        self.font_title['anchor_y'] ='top'
        self.font_title['anchor_x'] ='right'
        title = Label('A SOUND LOVE STORY', **self.font_title )
        title.position=(w-10,34)
        self.add(title,z=1)

        self.sound_fart = soundex.load('sounds/fart_01.mp3')

        self.schedule_interval( self.gasman_appear, 0.1 )

        sprite = sqa.SVG_CacheNode()
        node= sqa.SVGnode( data.filepath("sprites/gasman-character.svg") )
        sprite.add(node)
        self.add( sprite)
        self.gasman_sprite = sprite
        self.gasman_sprite.position = (-50, 200)
Example #3
0
    def __init__(self):
        super( MainMenu, self).__init__('TETRICO') 

        self.select_sound = soundex.load('move.mp3')

        # you can override the font that will be used for the title and the items
        # you can also override the font size and the colors. see menu.py for
        # more info
        self.font_title['font_name'] = 'Edit Undo Line BRK'
        self.font_title['font_size'] = 72
        self.font_title['color'] = (204,164,164,255)

        self.font_item['font_name'] = 'Edit Undo Line BRK',
        self.font_item['color'] = (32,16,32,255)
        self.font_item['font_size'] = 32
        self.font_item_selected['font_name'] = 'Edit Undo Line BRK'
        self.font_item_selected['color'] = (32,16,32,255)
        self.font_item_selected['font_size'] = 46


        # example: menus can be vertical aligned and horizontal aligned
        self.menu_anchor_y = CENTER
        self.menu_anchor_x = CENTER

        items = []

        items.append( MenuItem('New Game', self.on_new_game) )
        items.append( MenuItem('Options', self.on_options) )
        items.append( MenuItem('Scores', self.on_scores) )
        items.append( MenuItem('Quit', self.on_quit) )

        self.create_menu( items, shake(), shake_back() )
Example #4
0
    def __init__(self):
        super(MainMenu, self).__init__("TETRICO")

        self.select_sound = soundex.load("move.mp3")

        # you can override the font that will be used for the title and the items
        # you can also override the font size and the colors. see menu.py for
        # more info
        self.font_title["font_name"] = "Edit Undo Line BRK"
        self.font_title["font_size"] = 72
        self.font_title["color"] = (204, 164, 164, 255)

        self.font_item["font_name"] = ("Edit Undo Line BRK",)
        self.font_item["color"] = (32, 16, 32, 255)
        self.font_item["font_size"] = 32
        self.font_item_selected["font_name"] = "Edit Undo Line BRK"
        self.font_item_selected["color"] = (32, 16, 32, 255)
        self.font_item_selected["font_size"] = 46

        # example: menus can be vertical aligned and horizontal aligned
        self.menu_anchor_y = CENTER
        self.menu_anchor_x = CENTER

        items = []

        items.append(MenuItem("New Game", self.on_new_game))
        items.append(MenuItem("Options", self.on_options))
        items.append(MenuItem("Scores", self.on_scores))
        items.append(MenuItem("Quit", self.on_quit))

        self.create_menu(items, shake(), shake_back())
Example #5
0
    def __init__(self):
        super( OptionsMenu, self).__init__('SO LONG') 
        self.select_sound = soundex.load('move.mp3')

        # you can override the font that will be used for the title and the items
        self.font_title['font_name'] = 'Edit Undo Line BRK'
        self.font_title['font_size'] = 72
#        self.font_title['color'] = (204,164,164,255)
        self.font_title['color'] = (255,255,255,255)


        self.font_item['font_name'] = 'Edit Undo Line BRK',
        self.font_item['color'] = (32,16,32,255)
        self.font_item['font_size'] = 32
        self.font_item_selected['font_name'] = 'Edit Undo Line BRK'
        self.font_item_selected['color'] = (32,16,32,255)
        self.font_item_selected['font_size'] = 46

        # you can also override the font size and the colors. see menu.py for
        # more info

        # example: menus can be vertical aligned and horizontal aligned
        self.menu_anchor_y = CENTER
        self.menu_anchor_x = CENTER

        items = []

        self.volumes = ['Mute','10','20','30','40','50','60','70','80','90','100']

        self.levels = [ str(i) for i in range( len(levels.levels))]

        items.append( MultipleMenuItem(
                        'Start Level: ', 
                        self.on_level,
                        self.levels,
                        int(state.start_level) )
                    )

        items.append( MultipleMenuItem(
                        'SFX volume: ', 
                        self.on_sfx_volume,
                        self.volumes,
                        int(soundex.sound_vol * 10) )
                    )
        items.append( MultipleMenuItem(
                        'Music volume: ', 
                        self.on_music_volume,
                        self.volumes,
                        int(soundex.music_player.volume * 10) )
                    )
        items.append( ToggleMenuItem('Show FPS:', self.on_show_fps, director.show_FPS) )
        items.append( MenuItem('Fullscreen', self.on_fullscreen) )
        items.append( MenuItem('Back', self.on_quit) )
        self.create_menu( items, shake(), shake_back() )
Example #6
0
    def __init__(self):
        super(OptionsMenu, self).__init__('TETRICO')
        self.select_sound = soundex.load('move.mp3')

        # you can override the font that will be used for the title and the items
        self.font_title['font_name'] = 'Edit Undo Line BRK'
        self.font_title['font_size'] = 72
        self.font_title['color'] = (204, 164, 164, 255)

        self.font_item['font_name'] = 'Edit Undo Line BRK',
        self.font_item['color'] = (32, 16, 32, 255)
        self.font_item['font_size'] = 32
        self.font_item_selected['font_name'] = 'Edit Undo Line BRK'
        self.font_item_selected['color'] = (32, 16, 32, 255)
        self.font_item_selected['font_size'] = 46

        # you can also override the font size and the colors. see menu.py for
        # more info

        # example: menus can be vertical aligned and horizontal aligned
        self.menu_anchor_y = CENTER
        self.menu_anchor_x = CENTER

        items = []

        self.volumes = ['Mute', '10', '20', '30', '40', '50', '60', '70', '80', '90', '100']

        items.append(MultipleMenuItem(
            'SFX volume: ',
            self.on_sfx_volume,
            self.volumes,
            int(soundex.sound_vol * 10))
        )
        items.append(MultipleMenuItem(
            'Music volume: ',
            self.on_music_volume,
            self.volumes,
            int(soundex.music_player.volume * 10))
        )
        items.append(ToggleMenuItem('Show FPS:', self.on_show_fps, director.show_FPS))
        items.append(MenuItem('Fullscreen', self.on_fullscreen))
        items.append(MenuItem('Back', self.on_quit))
        items.append(
            MenuItem("get window size", self.on_get_window_size, director._usable_width, director._usable_height))
        self.create_menu(items, shake(), shake_back())
Example #7
0
    def __init__(self):
        super(OptionsMenu, self).__init__("TETRICO")
        self.select_sound = soundex.load("move.mp3")

        # you can override the font that will be used for the title and the items
        self.font_title["font_name"] = "Edit Undo Line BRK"
        self.font_title["font_size"] = 72
        self.font_title["color"] = (204, 164, 164, 255)

        self.font_item["font_name"] = ("Edit Undo Line BRK",)
        self.font_item["color"] = (32, 16, 32, 255)
        self.font_item["font_size"] = 32
        self.font_item_selected["font_name"] = "Edit Undo Line BRK"
        self.font_item_selected["color"] = (32, 16, 32, 255)
        self.font_item_selected["font_size"] = 46

        # you can also override the font size and the colors. see menu.py for
        # more info

        # example: menus can be vertical aligned and horizontal aligned
        self.menu_anchor_y = CENTER
        self.menu_anchor_x = CENTER

        items = []

        self.volumes = ["Mute", "10", "20", "30", "40", "50", "60", "70", "80", "90", "100"]

        items.append(MultipleMenuItem("SFX volume: ", self.on_sfx_volume, self.volumes, int(soundex.sound_vol * 10)))
        items.append(
            MultipleMenuItem(
                "Music volume: ", self.on_music_volume, self.volumes, int(soundex.music_player.volume * 10)
            )
        )
        items.append(ToggleMenuItem("Show FPS:", self.on_show_fps, director.show_FPS))
        items.append(MenuItem("Fullscreen", self.on_fullscreen))
        items.append(MenuItem("Back", self.on_quit))
        self.create_menu(items, shake(), shake_back())
Example #8
0
 def start_music(self):
     self.music = soundex.load('music/theme1.mp3')
     soundex.music_volume(40)
     soundex.sound_volume(40)
     soundex.play_music()