-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathstart_objects.py
More file actions
133 lines (120 loc) · 5.06 KB
/
Copy pathstart_objects.py
File metadata and controls
133 lines (120 loc) · 5.06 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
from base_objects import StartGameObject
import pygame
_SPIKE_ROTATION_KEYS = {
0: "spr_stand_spikes_0_degrees",
90: "spr_stand_spikes_90_degrees",
180: "spr_stand_spikes_180_degrees",
270: "spr_stand_spikes_270_degrees",
}
_SPIKE_ROTATION_KEYS_START = {
0: "spr_stand_spikes_0_degrees_start",
90: "spr_stand_spikes_90_degrees_start",
180: "spr_stand_spikes_180_degrees_start",
270: "spr_stand_spikes_270_degrees_start",
}
class StartWall(StartGameObject):
def __init__(self, position, images):
super().__init__(images["spr_wall_start"], position)
self.images = images
def toggle_image_start_or_drag(self, dragging_bool):
if dragging_bool:
self.image = self.images["spr_wall"]
else:
self.image = self.images["spr_wall_start"]
class StartReverseWall(StartGameObject):
def __init__(self, position, images):
super().__init__(images["spr_reverse_wall_start"], position)
self.images = images
def toggle_image_start_or_drag(self, dragging_bool):
if dragging_bool:
self.image = self.images["spr_reverse_wall"]
else:
self.image = self.images["spr_reverse_wall_start"]
class StartDiamonds(StartGameObject):
def __init__(self, position, images):
super().__init__(images["spr_diamonds_start"], position)
self.images = images
def toggle_image_start_or_drag(self, dragging_bool):
if dragging_bool:
self.image = self.images["spr_diamonds"]
else:
self.image = self.images["spr_diamonds_start"]
class StartDoor(StartGameObject):
def __init__(self, position, images):
super().__init__(images["spr_door_closed_start"], position)
self.images = images
def toggle_image_start_or_drag(self, dragging_bool):
if dragging_bool:
self.image = self.images["spr_door_closed"]
else:
self.image = self.images["spr_door_closed_start"]
class StartFlyer(StartGameObject):
def __init__(self, position, images):
super().__init__(images["spr_flyer_start"], position)
self.images = images
def toggle_image_start_or_drag(self, dragging_bool):
if dragging_bool:
self.image = self.images["spr_flyer"]
else:
self.image = self.images["spr_flyer_start"]
class StartSmilyRobot(StartGameObject):
def __init__(self, position, images):
super().__init__(images["spr_smily_robot_start"], position)
self.images = images
def toggle_image_start_or_drag(self, dragging_bool):
if dragging_bool:
self.image = self.images["spr_smily_robot"]
else:
self.image = self.images["spr_smily_robot_start"]
class StartSpring(StartGameObject):
def __init__(self, position, images):
super().__init__(images["spr_spring_start"], position)
self.images = images
def toggle_image_start_or_drag(self, dragging_bool):
if dragging_bool:
self.image = self.images["spr_spring"]
else:
self.image = self.images["spr_spring_start"]
class StartPlayer(StartGameObject):
def __init__(self, position, images):
super().__init__(images["spr_player_start"], position)
self.images = images
def toggle_image_start_or_drag(self, dragging_bool):
if dragging_bool:
self.image = self.images["spr_player"]
else:
self.image = self.images["spr_player_start"]
class StartStickyBlock(StartGameObject):
def __init__(self, position, images):
super().__init__(images["spr_sticky_block_start"], position)
self.images = images
def toggle_image_start_or_drag(self, dragging_bool):
if dragging_bool:
self.image = self.images["spr_sticky_block"]
else:
self.image = self.images["spr_sticky_block_start"]
class StartFallSpikes(StartGameObject):
def __init__(self, position, images):
super().__init__(images["spr_fall_spikes_start"], position)
self.images = images
def toggle_image_start_or_drag(self, dragging_bool):
if dragging_bool:
self.image = self.images["spr_fall_spikes"]
else:
self.image = self.images["spr_fall_spikes_start"]
class StartStandSpikes(StartGameObject):
def __init__(self, position, images):
self.images = images
self.image = self.images["spr_stand_spikes_0_degrees_start"]
super().__init__(self.image, position)
self.rotate = 0
def change_image_rotation(self, rotate):
self.rotate = rotate
self.image = self.images[_SPIKE_ROTATION_KEYS_START[self.rotate]]
def toggle_image_start_or_drag(self, dragging_bool):
key_map = _SPIKE_ROTATION_KEYS if dragging_bool else _SPIKE_ROTATION_KEYS_START
self.image = self.images[key_map[self.rotate]]
class RotateButton(StartGameObject):
def __init__(self, position, images):
super().__init__(images["spr_rotate_button"], position)
self.current_stand_spikes_rotate = 0