Mercurial > skaapsteker
diff skaapsteker/sprites/player.py @ 102:2e913a89e69d
Link up key presses to calls to action functions on player and to quitting level.
author | Simon Cross <hodgestar@gmail.com> |
---|---|
date | Mon, 04 Apr 2011 20:23:14 +0200 |
parents | 3eafceff6293 |
children | aaef228b6358 |
line wrap: on
line diff
--- a/skaapsteker/sprites/player.py Mon Apr 04 19:34:20 2011 +0200 +++ b/skaapsteker/sprites/player.py Mon Apr 04 20:23:14 2011 +0200 @@ -42,9 +42,23 @@ self.starting_tile_pos = pos self.rect = self.image.get_rect(topleft=(pos[0]*TILE_SIZE[0], pos[1]*TILE_SIZE[1])) + def action_left(self): + print "L" - def dispatch(self, ev): - pass + def action_right(self): + print "R" + + def action_up(self): + print "U" + + def action_down(self): + print "D" + + def action_fire1(self): + print "F1" + + def action_fire2(self): + print "F2" def _get_action(self): if self.running: @@ -53,7 +67,6 @@ return 'jumpin' return 'standing' - def _make_key(self, action=None): if action is None: action = self._get_action()