changeset 399:488ab520408c

Collide with floors
author Neil Muller <drnlmuller@gmail.com>
date Sat, 09 Apr 2011 16:41:38 +0200
parents 6850a3ab3aac
children 1501d9b7f5dd
files skaapsteker/sprites/base.py
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/skaapsteker/sprites/base.py	Sat Apr 09 16:40:01 2011 +0200
+++ b/skaapsteker/sprites/base.py	Sat Apr 09 16:41:38 2011 +0200
@@ -229,12 +229,14 @@
     def collided(self, other):
         Monster.collided(self, other)
         # Check if the object we've collided with is the same height our higher than us
-        if other.block and other.collide_rect.bottom <= self.collide_rect.bottom:
+        if (other.block or other.floor) and other.collide_rect.bottom <= self.collide_rect.bottom:
             # Change direction
             if self.facing == 'left':
                 self.facing = 'right'
+                self._update_image(True)
             else:
                 self.facing = 'left'
+                self._update_image(True)
 
 
 class NPC(AnimatedGameSprite):