Strip newlines off map when loading
[erdslangetjie.git] / erdslangetjie / player.py
1 # Player and Player-like objects
2
3 from erdslangetjie.data import load_image
4
5
6 class PlayerSprite(object):
7
8     def __init__(self):
9         self.pos = (0, 0)
10         self.sprite = None
11
12     def move(self, direction):
13         self.pos = (self.pos[0] + direction[0], self.pos[1] + direction[1])
14
15     def get_image(self):
16         return self.sprite
17
18
19 class ThePlayer(PlayerSprite):
20
21     def __init__(self):
22         super(ThePlayer, self).__init__()
23         self.sprite = load_image('sprites/player.png')
24
25
26 class Nemesis(PlayerSprite):
27
28     def __init__(self):
29         super(ThePlayer, self).__init__()
30         self.sprite = load_image('sprites/nemesis.png')