Changeset 406:7fcde01ea50e for nagslang


Ignore:
Timestamp:
Sep 7, 2013, 9:16:59 AM (7 years ago)
Author:
Stefano Rivera <stefano@…>
Branch:
default
Message:

No, we really don't need EnemyDeathEvent?

Location:
nagslang
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • nagslang/enemies.py

    r393 r406  
    99from nagslang.constants import (COLLISION_TYPE_ENEMY, COLLISION_TYPE_FURNITURE,
    1010                                ACID_SPEED, ACID_DAMAGE, ZORDER_MID)
    11 from nagslang.events import EnemyDeathEvent
    1211from nagslang.game_object import (GameObject, SingleShapePhysicser, Result,
    1312                                  Bullet, make_body)
     
    7170        self.health -= amount
    7271        if self.health <= 0:
    73             EnemyDeathEvent.post()
     72            self.world.kills += 1
    7473            self.physicser.remove_from_space()
    7574
  • nagslang/events.py

    r394 r406  
    4545    def post(cls, destination, dest_pos):
    4646        super(DoorEvent, cls).post(destination=destination, dest_pos=dest_pos)
    47 
    48 
    49 class EnemyDeathEvent(UserEvent):
    50     @classmethod
    51     def post(cls):
    52         super(EnemyDeathEvent, cls).post()
  • nagslang/screens/area.py

    r399 r406  
    99    COLLISION_TYPE_FURNITURE, COLLISION_TYPE_WEREWOLF_ATTACK,
    1010    CMD_TOGGLE_FORM, CMD_ACTION)
    11 from nagslang.events import ScreenChange, DoorEvent, EnemyDeathEvent
     11from nagslang.events import ScreenChange, DoorEvent
    1212from nagslang.level import Level
    1313from nagslang.screens.base import Screen
     
    178178            # else we're teleporting within the screen, and just the
    179179            # position change is enough
    180         elif EnemyDeathEvent.matches(ev):
    181             self.world.kills += 1
    182180        self.keys.handle_event(ev)
    183181
Note: See TracChangeset for help on using the changeset viewer.