From 191d328780140fad352f168ecb03069f10b4459b Mon Sep 17 00:00:00 2001 From: Neil Date: Mon, 15 Apr 2013 12:56:24 +0200 Subject: [PATCH] add basic player sprites --- erdslangetjie/player.py | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 erdslangetjie/player.py diff --git a/erdslangetjie/player.py b/erdslangetjie/player.py new file mode 100644 index 0000000..6fc26e8 --- /dev/null +++ b/erdslangetjie/player.py @@ -0,0 +1,30 @@ +# Player and Player-like objects + +from erdslangetjie.data import load_image + + +class PlayerSprite(object): + + def __init__(self): + self.pos = (0, 0) + self.sprite = None + + def move(self, direction): + self.pos = (self.pos[0] + direction[0], self.pos[1] + direction[1]) + + def get_image(self): + return self.sprite + + +class ThePlayer(PlayerSprite): + + def __init__(self): + super(ThePlayer, self).__init__() + self.sprite = load_image('sprites/player.png') + + +class Nemesis(PlayerSprite): + + def __init__(self): + super(ThePlayer, self).__init__() + self.sprite = load_image('sprites/nemesis.png') -- 2.34.1