Changeset 332:971c1726c530


Ignore:
Timestamp:
04/09/11 00:16:03 (12 years ago)
Author:
Neil Muller <drnlmuller@…>
Branch:
default
Phase:
public
Message:

don't set position and level when creating a sprite just for the inventory image

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • BUGS.txt

    r331 r332  
    11* When you bring tea to the monk you don't get rid of the item
    2 * When you die and respawn on the temple grounds while carrying tea the tea gets dropped by the door but is still in your inventory.  It actually is in your inventory, because you can walk away from the door and really drop it.  The ghost tea disappears if you activate the door.
    32
    43FIXED
    54=====
    65* When you re-enter the temple the monk's conversation tree restarts
     6* When you die and respawn on the temple grounds while carrying tea the tea gets dropped by the door but is still in your inventory.  It actually is in your inventory, because you can walk away from the door and really drop it.  The ghost tea disappears if you activate the door.
  • skaapsteker/sprites/player.py

    r328 r332  
    302302
    303303
    304     def get_sprite(self):
     304    def get_sprite(self, set_level):
    305305        my_item = self.the_world.fox.item
    306306        if my_item is None:
    307307            return None
    308308        world_item = getattr(self.the_world.items, my_item)
    309         world_item.level = self.the_world.fox.level
    310         world_item.pos = [a/b for a, b in zip(self.rect.center, TILE_SIZE)]
     309        if set_level:
     310            world_item.level = self.the_world.fox.level
     311            world_item.pos = [a/b for a, b in zip(self.rect.center, TILE_SIZE)]
    311312        sprite_dict = world_item.copy()
    312313        sprite_dict.pop('level')
     
    317318
    318319    def drop_item(self):
    319         sprite = self.get_sprite()
     320        sprite = self.get_sprite(True)
    320321        if sprite is None:
    321322            return
     
    332333
    333334    def make_inventory_image(self):
    334         sprite = self.get_sprite()
     335        sprite = self.get_sprite(False)
    335336        if sprite is None:
    336337            self.inventory_image = None
     
    343344            new_width = int(image.get_width() * (48.0 / image.get_height()))
    344345        self.inventory_image = pygame.transform.scale(image, (new_width, new_height))
     346        sprite.kill() # ensure we don't leak into the scene at any point
    345347
    346348
Note: See TracChangeset for help on using the changeset viewer.