diff skaapsteker/sprites/player.py @ 362:02bf05964619

FIREBALLS!
author Simon Cross <hodgestar@gmail.com>
date Sat, 09 Apr 2011 14:25:45 +0200
parents eacb3e1bc1d1
children 249ba3bd6904
line wrap: on
line diff
--- a/skaapsteker/sprites/player.py	Sat Apr 09 14:22:04 2011 +0200
+++ b/skaapsteker/sprites/player.py	Sat Apr 09 14:25:45 2011 +0200
@@ -3,7 +3,7 @@
 import pygame.transform
 import time
 
-from ..sprites.base import find_sprite, TILE_SIZE, PC_LAYER, MONSTER_LAYER
+from ..sprites.base import find_sprite, Monster, TILE_SIZE, PC_LAYER, MONSTER_LAYER, PROJECTILE_LAYER
 from ..sprites.projectiles import Fireball
 from ..physics import Sprite
 from ..constants import Layers, FoxHud
@@ -14,7 +14,7 @@
 class Player(Sprite):
 
     collision_layer = PC_LAYER
-    collides_with = set([MONSTER_LAYER])
+    collides_with = set([MONSTER_LAYER, PROJECTILE_LAYER])
     wants_updates = True
 
     block = True
@@ -277,7 +277,7 @@
             pos = pygame.Rect(self.rect.midleft, (0, 0))
         else:
             pos = pygame.Rect(self.rect.midright, (0, 0))
-        fireball = Fireball(pos, direction=self.facing)
+        fireball = Fireball(pos, direction=self.facing, hits=Monster)
         AddSpriteEvent.post(fireball)
 
     def _lightning_attack(self):