Пример #1
0
    def Reset(self):
        
        
        global x_pos, y_pos, x_change, y_change, velocity, bg_pos, reset, playing
        print "All sprites ", all_sprites_list
        print "Planes ", planes_list
        print "Enemy bullets ",enemy_bullet_list
        print "Bullets ",bullet_list
        print "Enemys ",enemy_list
        

        for sprite in all_sprites_list:
            sprite.kill()
        
        reset = True
        velocity = 1
        x_pos = 300 #largura
        y_pos = 600 #altura
        x_change = 0   
        y_change = 0   
        self.lives -=1
        #bg_pos = -5800
        #clouds_pos = -5800
        
        self.MainLoop()
Пример #2
0
 def remove_plane(self, plane):
     '''
     Remove aeroplanes from the aerospace.
     '''
     for sprite in self.__planes[plane.icao]['sprites']:
         sprite.kill()
     del self.__planes[plane.icao]
Пример #3
0
 def remove_strip(self, plane):
     '''
     Remove a strip from the sprite group based on its plane object.
     '''
     for sprite in self.sprites():
         if sprite.plane == plane:
             sprite.kill()
             return
Пример #4
0
    def kill_sprite_group(self, group: sprite.Group) -> None:
        """Method that kills all sprites in a group.

        Parameters
        ----------
        group: sprite.Group -> group of sprites to be disposed of

        Tests
        -----
        * not passing a sprite group as group
        * sprite.kill() method is overwritten
        """
        # kill all sprites in a to improve performance
        for sprite in group:
            sprite.kill()