Changeset 442:a084af91d5dc


Ignore:
Timestamp:
04/09/11 17:41:20 (12 years ago)
Author:
Neil Muller <drnlmuller@…>
Branch:
default
Phase:
public
Rebase:
63396636323362393831646564353761306639323366396362343637653630353632653138613639
Message:

Make breakable items break

Location:
skaapsteker/sprites
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • skaapsteker/sprites/items.py

    r434 r442  
    11from .. import engine
    2 from .base import Item
     2from .base import Item, PC_LAYER, PROJECTILE_LAYER
     3
    34
    45
     
    1011    whole_image_file = None
    1112    broken_image_file = None
     13
     14    collides_with = set([PC_LAYER, PROJECTILE_LAYER])
    1215
    1316    def setup(self, broken, **opts):
     
    2629        self.setup_image_data(self._starting_tile_pos)
    2730
     31    def damage(self, damage):
     32        self.smash()
    2833
    2934
  • skaapsteker/sprites/player.py

    r441 r442  
    66from ..sprites.base import find_sprite, Monster, TILE_SIZE, PC_LAYER, MONSTER_LAYER, PROJECTILE_LAYER
    77from ..sprites.projectiles import Fireball, Lightning
     8from ..sprites.items import BreakableItem
    89from ..physics import Sprite
    910from ..constants import Layers, FoxHud, DOUBLE_TAP_TIME
     
    360361        else:
    361362            pos = pygame.Rect(self.rect.midright, (0, 0))
    362         projectile = cls(pos, direction=self.facing, hits=Monster, source=self)
     363        projectile = cls(pos, direction=self.facing, hits=(Monster, BreakableItem), source=self)
    363364        AddSpriteEvent.post(projectile)
    364365
Note: See TracChangeset for help on using the changeset viewer.