-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSpritesFile.py
More file actions
138 lines (123 loc) · 2.58 KB
/
Copy pathSpritesFile.py
File metadata and controls
138 lines (123 loc) · 2.58 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
from dataclasses import dataclass, field
@dataclass
class Block:
x: int
y: int
image: int
image_x1: int
image_x2: int
image_y1: int
image_y2: int
blocktype: str
direction: str = 'North'
lives: int = 0
@dataclass
class Stone(Block):
image: int = 0
image_x1: int = 0
image_x2: int = 8
image_y1: int = 32
image_y2: int = 8
blocktype: str = 'Stone'
@dataclass
class Brick(Block):
image: int = 0
image_x1: int = 8
image_x2: int = 8
image_y1: int = 32
image_y2: int = 8
lives: int = 2
blocktype: str = 'Brick'
@dataclass
class MirrorUp(Block):
image: int = 0
image_x1: int = 0
image_x2: int = 8
image_y1: int = 40
image_y2: int = 8
blocktype: str = 'MirrorUp'
@dataclass
class MirrorDown(Block):
image: int = 0
image_x1: int = 8
image_x2: int = 8
image_y1: int = 40
image_y2: int = 8
blocktype: str = 'MirrorDown'
@dataclass
class Forest(Block):
image: int = 0
image_x1: int = 0
image_x2: int = 8
image_y1: int = 56
image_y2: int = 8
blocktype: str = 'Forest'
@dataclass
class Water(Block):
image: int = 0
image_x1: int = 8
image_x2: int = 8
image_y1: int = 48
image_y2: int = 8
blocktype: str = 'Water'
@dataclass
class Home(Block):
image: int = 0
image_x1: int = 8
image_x2: int = 8
image_y1: int = 56
image_y2: int = 8
blocktype: str = 'Home'
@dataclass
class Powerup(Block):
image: int = 0
image_x1: int = 0
image_x2: int = 8
image_y1: int = 64
image_y2: int = 8
blocktype: str = 'Powerup'
@dataclass
class Bullet:
x: float = 0
y: float = 0
speed: float = 2
direction: str = 'North'
active: bool = False # Indicates if the bullet is currently active
image: int = 1
image_x1: int = 0
image_x2: int = 2
image_y1: int = 0
image_y2: int = 2
@dataclass
class Tank:
x: float
y: float
tank_type: str
lives:int
image: int = 0
direction: str = 'North'
image_x1: int = 0
image_x2: int = 8
image_y1: int = 0
image_y2: int = 8
bullet: Bullet = field(default_factory=Bullet)
@dataclass
class PlayerTank(Tank):
lives: int = 3
tank_type: str = 'player'
@dataclass
class EnemyTank1(Tank):
lives: int = 1
image_x1: int = 16
image_x2: int = 8
image_y1: int = 0
image_y2: int = 8
tank_type: str = 'enemytank1'
@dataclass
class EnemyTank2(Tank):
lives: int = 2
image_x1: int = 0
image_x2: int = 8
image_y1: int = 16
image_y2: int = 8
tank_type: str = 'enemytank2'