Exemplo n.º 1
0
 def on_lose_life(self, lives):
     # Make an explosion particle effect
     p = Explosion()
     p.position = self.player.position
     self.particles.add(p)
     p.do(Delay(5) + CallFunc(p.kill))
     # Reset the player to the center of the screen
     w, h = director.get_window_size()
     self.player.position = w / 2, h / 2
     # If the player is out of lives it's game over.
     if lives == 0:
         import getgameover
         self.current_level.player.pause()
         director.replace(getgameover.get_scene(self.player.score))
Exemplo n.º 2
0
    def on_lose_life(self, lives):
        # Make an explosion particle effect
        p = Explosion()
        p.position = self.player.position
        self.particles.add(p)
        p.do(Delay(5) + CallFunc(p.kill))
        # Reset the player to the center of the screen
        w, h = director.get_window_size()
        self.player.position = w / 2, h / 2
        # If the player is out of lives it's game over.
        if lives == 0:
            import getgameover

            self.current_level.player.pause()
            director.replace(getgameover.get_scene(self.player.score))
Exemplo n.º 3
0
	def explode(self, asteroid):
		explode = Explosion()
		'''
		if asteroid.morph == "large":
			explode.size = 25
		elif asteroid.morph == 'medium':
			explode.size = 15
		elif asteroid.morph == 'small':
			explode.size = 5
		'''
		explode.size = 5	
		explode.start_color = Color( 255, 0, 0, 255 )
		explode.end_color = Color(255,0,0,255)
		explode.total_particles = 10
		explode.position = asteroid.position
		explode.auto_remove_on_finish = True
		self.add(explode)