Beispiel #1
0
    def __init__(self, image_filename, position, size, direction):
        '''
        Intitializes a BulletSprite

        @param image_filename - The file name of the sprite's image
        @param position - The position of the sprite
        @param size - The size of teh sprite
        @param direction - The direction of the sprite
        '''

        EntitySprite.__init__(self, position, size)
        self.direction = direction
        self.image = pygame.image.load(image_filename)
        self._reset_rect()
Beispiel #2
0
    def __init__(self, image_filename, position, size, direction):
        '''
        Initializes the CreatureSprite to be called from subclasses

        @param image_filename - The file name of spritesheet
        @param position - The position of the sprite on the map
        @param size - The size fo the sprite
        @param direction - The direction its facing in the game
        '''
        EntitySprite.__init__(self, position, size)
        self.action_wait_val = 12
        self.iters_until_action = 0
        self.direction = direction
        self._create_spritesheet(image_filename)
Beispiel #3
0
    def __init__ (self, position=(0, 0), size=(0, 0), json=None):
    	'''
    	Initializes the gate

    	@param position - optional argument to specify position
        @param size - optional argument to specify size of sprite
        @param direction - optional argument to specify direction facing when initialized
        @param json - optional argument to be used when loading from a json file
    	'''

        EntitySprite.__init__(self, position, size)
        if json:
            self.from_json(json)
        self.image = self._scale(self.normal)
        self._reset_rect()