Mercurial > skaapsteker
diff skaapsteker/sprites/player.py @ 273:95e2ef31e714
Hit "down" to interact with things.
author | Jeremy Thurgood <firxen@gmail.com> |
---|---|
date | Fri, 08 Apr 2011 19:09:09 +0200 |
parents | 630ebb87b38a |
children | 8cac6ff88a9d |
line wrap: on
line diff
--- a/skaapsteker/sprites/player.py Fri Apr 08 17:32:50 2011 +0200 +++ b/skaapsteker/sprites/player.py Fri Apr 08 19:09:09 2011 +0200 @@ -71,6 +71,7 @@ self.init_pos() def update(self): + self._touching_actionables = [] v_x, v_y = self.velocity # Never animate slower than !7 fps, never faster than ~15 fps if self.attacking > 0: @@ -225,7 +226,10 @@ self.on_solid = False def action_down(self): - self.deltav((0.0, 100.0)) + print self._touching_actionables + for actionable in self._touching_actionables[:1]: + actionable.player_action(self) + def action_fire1(self): # FIXME: Use the correct tail properties for this @@ -296,3 +300,7 @@ self.the_world.fox.item = item.name item.kill() print "took", item + + + def add_actionable(self, actionable): + self._touching_actionables.append(actionable)