-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathscore.py
More file actions
39 lines (32 loc) · 971 Bytes
/
score.py
File metadata and controls
39 lines (32 loc) · 971 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
34
35
36
37
38
39
class points:
'''
The class that represents the counter of points
Attributes:
xpos - the positon to of the counter in the x axis
ypos - the positon to of the counter in the y axis
score - the amount of points mario has
Methods:
scorepoints - recives an input and sums it to the total amount of points
socrereset - puts the total amount of points back to 0
@Property methods - return an attribute
'''
__xpos = 0
__ypos = 0
__score = 0
def __init__(self, x, y, score = 0):
self.__xpos = x
self.__ypos = y
self.__score = score
@property
def score(self):
return self.__score
@property
def xpos(self):
return self.__xpos
@property
def ypos(self):
return self.__ypos
def scorespoint(self, c):
self.__score += c
def scorereset(self):
self.__score = 0