Mercurial > skaapsteker
view skaapsteker/sprites/enemies.py @ 336:c8fd82ff0c71
Hook up fire buttons to attack functions. Use correct check for tails. Add skeleton for projectiles.
author | Simon Cross <hodgestar@gmail.com> |
---|---|
date | Sat, 09 Apr 2011 12:29:34 +0200 |
parents | e499a10eb41f |
children | a2efe5470b79 |
line wrap: on
line source
from base import Monster from pygame import transform class RedOni(Monster): image_dir = 'sprites/oni red' attack_frame = 1 attack_damage = 10 frame_pause = 0.05 # Fast attacks facings = { 'running' : (('left', None), ('right', lambda x: transform.flip(x, True, False))), 'attacking' : (('left', None), ('right', lambda x: transform.flip(x, True, False))), } def setup(self, direction): self.facing = direction def start_attack(self, player): if self._animation != 'attacking': # Turn to face the player we're attacking if player.collide_rect.centerx > self.collide_rect.centerx: self.facing = 'right' else: self.facing = 'left' Monster.start_attack(self, player) class FireballOni(RedOni): pass # TODO