forked from SSBB231/Simple-Duck-Hunt
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathduckhuntplayers.py
More file actions
64 lines (45 loc) · 1.32 KB
/
Copy pathduckhuntplayers.py
File metadata and controls
64 lines (45 loc) · 1.32 KB
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#This module contains all the player classes and their respecsctive helper classes.
##====================================================
class Player(object):
#Player class constructor
def __init__(self):
#Initializes score to zero.
self.score = 0
self.name = "P"
#Returns a 2-tuple with the location at which
#the player shot at the screen.
def shotAt(self):
return (0,0)
def update_score(self, points):
self.score += points
def update(self):
pass
def getName(self):
pass
def __eq__(self , other):
self.name == other.name
##====================================================
##====================================================
class InteractivePlayer(Player):
#Player class constructor
def __init__(self):
Player.__init__(self)
self.name = "P1"
#Returns a 2-tuple with the location at which
#the player shot at the screen.
def update(self):
pass
def getName(self):
return self.name
##====================================================
##====================================================
#Class that represents the robot that will play as this game's player.
class Robot(Player):
def __init__(self):
Player.__init__(self)
self.name = "R"
def shotAt(self):
return (0,0)
def update():
pass
##====================================================