-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathenemies.py
More file actions
33 lines (27 loc) · 699 Bytes
/
enemies.py
File metadata and controls
33 lines (27 loc) · 699 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
class Enemy:
def __init__(self):
raise NotImplementedError("Do not create raw Enemy objects.")
def __str__(self):
return self.name
def is_alive(self):
return self.hp > 0
class BrownBear(Enemy):
def __init__(self):
self.name = "Brown Bear"
self.hp = 70
self.damage = 10
class GrayWolf(Enemy):
def __init__(self):
self.name = "Gray Wolf"
self.hp = 50
self.damage = 8
class Bunny(Enemy):
def __init__(self):
self.name = "Bunny"
self.hp = 5
self.damage = 3
class RedFox(Enemy):
def __init__(self):
self.name = "Red Fox"
self.hp = 30
self.damage = 5