Exemple #1
0
 def on_new_level(self):
     soundex.play('go.mp3')
     self.stop()
     self.do(StopGrid())
     self.rotation = 0
     self.scale = 1
     return True
Exemple #2
0
 def on_new_level( self ):
     soundex.play('go.mp3')
     self.stop()
     self.do( StopGrid() )
     self.rotation = 0
     self.scale = 1
     return True
Exemple #3
0
    def __init__(self, win=False):
        super(GameOver, self).__init__(32, 32, 32, 64)

        w, h = director.get_window_size()

        if win:
            soundex.play('oh_yeah.mp3')
            msg = 'YOU WIN'
        else:
            soundex.play('no.mp3')
            msg = 'GAME OVER'

        label = Label(msg,
                      font_name='Edit Undo Line BRK',
                      font_size=54,
                      anchor_y='center',
                      anchor_x='center')
        label.position = (w / 2.0, h / 2.0)

        self.add(label)

        angle = 5
        duration = 0.05
        accel = 2
        rot = Accelerate(Rotate(angle, duration // 2), accel)
        rot2 = Accelerate(Rotate(-angle * 2, duration), accel)
        effect = rot + (rot2 + Reverse(rot2)) * 4 + Reverse(rot)

        label.do(Repeat(Delay(5) + effect))

        if hiscore.hiscore.is_in(status.status.score):
            self.hi_score = True

            label = Label(
                'Enter your name:',
                font_name='Edit Undo Line BRK',
                font_size=36,
                anchor_y='center',
                anchor_x='center',
                color=(32, 32, 32, 255),
            )
            label.position = (w / 2.0, h / 2.0)
            label.position = (w // 2, 300)
            self.add(label)

            self.name = Label(
                '',
                font_name='Edit Undo Line BRK',
                font_size=36,
                anchor_y='center',
                anchor_x='center',
                color=(32, 32, 32, 255),
            )
            self.name.position = (w // 2, 250)
            self.add(self.name)
        else:
            self.hi_score = False
Exemple #4
0
    def __init__( self, win = False):
        super(GameOver,self).__init__( 32,32,32,64)

        w,h = director.get_window_size()

        if win:
            soundex.play('oh_yeah.mp3')
            msg = 'YOU WIN'
        else:
            soundex.play('no.mp3')
            msg = 'GAME OVER'

        label = Label(msg,
                    font_name='Edit Undo Line BRK',
                    font_size=54,
                    anchor_y='center',
                    anchor_x='center' )
        label.position =  ( w/2.0, h/2.0 )

        self.add( label )

        angle = 5
        duration = 0.05
        accel = 2
        rot = Accelerate(Rotate( angle, duration//2 ), accel)
        rot2 = Accelerate(Rotate( -angle*2, duration), accel)
        effect = rot + (rot2 + Reverse(rot2)) * 4 + Reverse(rot)
        
        label.do( Repeat( Delay(5) + effect ) )

        if hiscore.hiscore.is_in( status.status.score ):
            self.hi_score = True

            label = Label('Enter your name:',
                        font_name='Edit Undo Line BRK',
                        font_size=36,
                        anchor_y='center',
                        anchor_x='center',
                        color=(32,32,32,255),
                        )
            label.position =  ( w/2.0, h/2.0 )
            label.position = (w//2, 300)
            self.add( label )

            self.name= Label('',
                        font_name='Edit Undo Line BRK',
                        font_size=36,
                        anchor_y='center',
                        anchor_x='center',
                        color=(32,32,32,255),
                        )
            self.name.position=(w//2,250)
            self.add(self.name)
        else:
            self.hi_score = False
Exemple #5
0
 def on_drop_block(self ):
     soundex.play('drop.mp3')
     return True
Exemple #6
0
 def on_move_block(self ):
     soundex.play('move.mp3')
     return True
Exemple #7
0
 def on_line_complete( self, lines ):
     soundex.play('line.mp3')
     return True
Exemple #8
0
 def on_up_character(self ):
     soundex.play('line.mp3')
     return True
Exemple #9
0
 def on_move_snake(self ):
     soundex.play('move.mp3')
     return True
Exemple #10
0
 def on_drop_block(self):
     soundex.play('drop.mp3')
     return True
Exemple #11
0
 def on_move_block(self):
     soundex.play('move.mp3')
     return True
Exemple #12
0
 def on_line_complete(self, lines):
     soundex.play('line.mp3')
     return True
Exemple #13
0
 def on_up_character(self):
     soundex.play('line.mp3')
     return True
 def touched_goal_tail( self ):
     state.touched_goals += 1
     state.score += 1
     if state.touched_goals == self.level.goals:
         self.next_level()
     soundex.play('Gong_do.mp3')
Exemple #15
0
 def on_level_complete( self ):
     soundex.play('level_complete.mp3')
     self.hud.show_message('Level complete', self.model.set_next_level)
     return True
Exemple #16
0
 def on_level_complete(self):
     soundex.play('level_complete.mp3')
     self.hud.show_message('Level complete', self.model.set_next_level)
     return True
Exemple #17
0
    def __init__( self, win = False):
        super(GameOver,self).__init__( 32,32,32,64)

        w,h = director.get_window_size()

        self.win = win

        if win:
            soundex.play('sounds/you_win.mp3')
            msg = 'FART IN LOVE'
        else:
            soundex.play('sounds/game_over_01.mp3')
            msg = 'GAME OVER'

        label = Label(msg,
                    font_name=FONT_NAME,
                    font_size=54,
                    anchor_y='center',
                    anchor_x='center' )
        label.position =  ( w/2.0, h/2.0 )

        self.add( label )

        angle = 5
        duration = 0.05
        accel = 2
        rot = Accelerate(Rotate( angle, duration//2 ), accel)
        rot2 = Accelerate(Rotate( -angle*2, duration), accel)
        effect = rot + (rot2 + Reverse(rot2)) * 4 + Reverse(rot)
        
        label.do( Repeat( Delay(5) + effect ) )

        if hiscore.hiscore.is_in( state.score ):
            self.hi_score = True

            label = Label('Enter your name:',
                        font_name=FONT_NAME,
                        font_size=36,
                        anchor_y='center',
                        anchor_x='center',
                        color=(32,32,32,255),
                        )
            label.position =  ( w/2.0, h/2.0 )
            label.position = (w//2, 130)
            self.add( label )

            self.name= Label('',
                        font_name=FONT_NAME,
                        font_size=36,
                        anchor_y='center',
                        anchor_x='center',
                        color=(32,32,32,255),
                        )
            self.name.position=(w//2,80)
            self.add(self.name)
        else:
            self.hi_score = False

            if not self.win:
                label = Label("Press 'R' to restart level",
                            font_name=FONT_NAME,
                            font_size=18,
                            anchor_y='center',
                            anchor_x='center' )
                label.position =  ( w/2.0, 20 )
                self.add( label )