1 |
commit: 8859475f04b25dda813189a816e46781c6c687aa |
2 |
Author: Pacho Ramos <pacho <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Dec 25 17:22:51 2019 +0000 |
4 |
Commit: Pacho Ramos <pacho <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Dec 25 17:22:51 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8859475f |
7 |
|
8 |
games-arcade/whichwayisup: Fixes from Fedora, use python3 |
9 |
|
10 |
Package-Manager: Portage-2.3.82, Repoman-2.3.20 |
11 |
Signed-off-by: Pacho Ramos <pacho <AT> gentoo.org> |
12 |
|
13 |
...up-0.7.9-check_for_joystick_axes_not_null.patch | 21 + |
14 |
...9-initialize_only_required_pygame_modules.patch | 23 + |
15 |
.../files/whichwayisup-0.7.9-python3.patch | 470 +++++++++++++++++++++ |
16 |
.../whichwayisup/whichwayisup-0.7.9-r3.ebuild | 62 +++ |
17 |
4 files changed, 576 insertions(+) |
18 |
|
19 |
diff --git a/games-arcade/whichwayisup/files/whichwayisup-0.7.9-check_for_joystick_axes_not_null.patch b/games-arcade/whichwayisup/files/whichwayisup-0.7.9-check_for_joystick_axes_not_null.patch |
20 |
new file mode 100644 |
21 |
index 00000000000..b97856a0d2b |
22 |
--- /dev/null |
23 |
+++ b/games-arcade/whichwayisup/files/whichwayisup-0.7.9-check_for_joystick_axes_not_null.patch |
24 |
@@ -0,0 +1,21 @@ |
25 |
+From: Markus Koschany <apo@××××××.org> |
26 |
+Date: Tue, 28 May 2013 18:40:34 +0200 |
27 |
+Subject: check for joystick axes not null |
28 |
+ |
29 |
+--- |
30 |
+ lib/game.py | 2 +- |
31 |
+ 1 file changed, 1 insertion(+), 1 deletion(-) |
32 |
+ |
33 |
+diff --git a/lib/game.py b/lib/game.py |
34 |
+index f0afd84..30f86fd 100644 |
35 |
+--- a/lib/game.py |
36 |
++++ b/lib/game.py |
37 |
+@@ -138,7 +138,7 @@ def parse_inputs(joystick = None): |
38 |
+ if keys[K_F10]: |
39 |
+ inputs["SPECIAL"] = True |
40 |
+ |
41 |
+- if joystick != None: # Parse joystick input |
42 |
++ if joystick != None and joystick.get_numaxes() != 0: # Parse joystick input |
43 |
+ |
44 |
+ axis0 = joystick.get_axis(0) |
45 |
+ |
46 |
|
47 |
diff --git a/games-arcade/whichwayisup/files/whichwayisup-0.7.9-initialize_only_required_pygame_modules.patch b/games-arcade/whichwayisup/files/whichwayisup-0.7.9-initialize_only_required_pygame_modules.patch |
48 |
new file mode 100644 |
49 |
index 00000000000..5bfea4ddd6e |
50 |
--- /dev/null |
51 |
+++ b/games-arcade/whichwayisup/files/whichwayisup-0.7.9-initialize_only_required_pygame_modules.patch |
52 |
@@ -0,0 +1,23 @@ |
53 |
+From: Markus Koschany <apo@××××××.org> |
54 |
+Date: Tue, 28 May 2013 18:21:54 +0200 |
55 |
+Subject: initialize only required pygame modules. |
56 |
+ |
57 |
+--- |
58 |
+ lib/main.py | 4 +++- |
59 |
+ 1 file changed, 3 insertions(+), 1 deletion(-) |
60 |
+ |
61 |
+diff --git a/lib/main.py b/lib/main.py |
62 |
+index cfe9046..6a0376a 100644 |
63 |
+--- a/lib/main.py |
64 |
++++ b/lib/main.py |
65 |
+@@ -60,7 +60,9 @@ def main(): |
66 |
+ |
67 |
+ #Initializing pygame and screen |
68 |
+ |
69 |
+- pygame.init() |
70 |
++ pygame.joystick.init() |
71 |
++ pygame.display.init() |
72 |
++ pygame.mixer.init() |
73 |
+ screen = pygame.display.set_mode((SCREEN_WIDTH,SCREEN_HEIGHT)) |
74 |
+ caption = "Which way is up?" |
75 |
+ if (Variables.vdict["devmode"]): |
76 |
|
77 |
diff --git a/games-arcade/whichwayisup/files/whichwayisup-0.7.9-python3.patch b/games-arcade/whichwayisup/files/whichwayisup-0.7.9-python3.patch |
78 |
new file mode 100644 |
79 |
index 00000000000..5b202640551 |
80 |
--- /dev/null |
81 |
+++ b/games-arcade/whichwayisup/files/whichwayisup-0.7.9-python3.patch |
82 |
@@ -0,0 +1,470 @@ |
83 |
+Author: Reiner Herrmann <reiner@××××××××.de> |
84 |
+Description: Port game to python3 |
85 |
+Bug-Debian: https://bugs.debian.org/912500 |
86 |
+ |
87 |
+--- a/run_game.py |
88 |
++++ b/run_game.py |
89 |
+@@ -1,4 +1,4 @@ |
90 |
+-#! /usr/bin/env python |
91 |
++#! /usr/bin/env python3 |
92 |
+ |
93 |
+ import sys |
94 |
+ import os |
95 |
+--- a/lib/util.py |
96 |
++++ b/lib/util.py |
97 |
+@@ -113,12 +113,12 @@ |
98 |
+ try: |
99 |
+ conffile = codecs.open(file_path, "w", "utf_8") |
100 |
+ for world in WORLDS: |
101 |
+- print >> conffile, "unlocked\t%(world)s\t%(unlocked)s" % {"world": world, "unlocked": Variables.vdict["unlocked" + world]} |
102 |
+- print >> conffile, "hiscore\t%(world)s\t%(hiscore)s" % {"world": world, "hiscore": Variables.vdict["hiscore" + world]} |
103 |
+- print >> conffile, "besttime\t%(world)s\t%(besttime)s" % {"world": world, "besttime": Variables.vdict["besttime" + world]} |
104 |
+- print >> conffile, "sound\t%s" % bool_to_str(Variables.vdict["sound"]) |
105 |
+- print >> conffile, "dialogue\t%s" % bool_to_str(Variables.vdict["dialogue"]) |
106 |
+- print >> conffile, "fullscreen\t%s" % bool_to_str(Variables.vdict["fullscreen"]) |
107 |
++ print("unlocked\t%(world)s\t%(unlocked)s" % {"world": world, "unlocked": Variables.vdict["unlocked" + world]}, file=conffile) |
108 |
++ print("hiscore\t%(world)s\t%(hiscore)s" % {"world": world, "hiscore": Variables.vdict["hiscore" + world]}, file=conffile) |
109 |
++ print("besttime\t%(world)s\t%(besttime)s" % {"world": world, "besttime": Variables.vdict["besttime" + world]}, file=conffile) |
110 |
++ print("sound\t%s" % bool_to_str(Variables.vdict["sound"]), file=conffile) |
111 |
++ print("dialogue\t%s" % bool_to_str(Variables.vdict["dialogue"]), file=conffile) |
112 |
++ print("fullscreen\t%s" % bool_to_str(Variables.vdict["fullscreen"]), file=conffile) |
113 |
+ except: |
114 |
+ error_message("Could not write configuration file to " + file_path) |
115 |
+ return False |
116 |
+@@ -136,13 +136,13 @@ |
117 |
+ count += 1 |
118 |
+ if count > MAX_OLD_LOG_LINES: |
119 |
+ break |
120 |
+- if Variables.vdict.has_key("log"): |
121 |
++ if "log" in Variables.vdict: |
122 |
+ try: |
123 |
+ conffile = codecs.open(file_path, "w", "utf_8") |
124 |
+- print >> conffile, "Log updated " + str(datetime.date.today()) |
125 |
+- print >> conffile, Variables.vdict["log"] |
126 |
+- print >> conffile, "" |
127 |
+- print >> conffile, old_log |
128 |
++ print("Log updated " + str(datetime.date.today()), file=conffile) |
129 |
++ print(Variables.vdict["log"], file=conffile) |
130 |
++ print("", file=conffile) |
131 |
++ print(old_log, file=conffile) |
132 |
+ except: |
133 |
+ error_message("Could not write log file to " + file_path) |
134 |
+ return False |
135 |
+@@ -166,7 +166,7 @@ |
136 |
+ The constant colors can be found from locals.py. |
137 |
+ ''' |
138 |
+ def render_text(string, color = COLOR_GUI, bgcolor = COLOR_GUI_BG): |
139 |
+- if Util.cached_text_images.has_key(string + str(color) + str(bgcolor)): |
140 |
++ if (string + str(color) + str(bgcolor)) in Util.cached_text_images: |
141 |
+ final_image = Util.cached_text_images[string + str(color) + str(bgcolor)] |
142 |
+ else: |
143 |
+ text_image_bg = Util.smallfont.render(string, True, bgcolor) |
144 |
+@@ -200,8 +200,8 @@ |
145 |
+ rendered_string = string[0:phase] |
146 |
+ string_image = render_text(rendered_string) |
147 |
+ string_rect = string_image.get_rect() |
148 |
+- string_rect.centerx = SCREEN_WIDTH / 2 |
149 |
+- string_rect.centery = SCREEN_HEIGHT / 2 |
150 |
++ string_rect.centerx = SCREEN_WIDTH // 2 |
151 |
++ string_rect.centery = SCREEN_HEIGHT // 2 |
152 |
+ |
153 |
+ if key == "p": |
154 |
+ skip_image = Util.cached_images["key_p"] |
155 |
+@@ -209,7 +209,7 @@ |
156 |
+ skip_image = Util.cached_images["key_z"] |
157 |
+ |
158 |
+ skip_rect = skip_image.get_rect() |
159 |
+- skip_rect.centerx = SCREEN_WIDTH / 2 |
160 |
++ skip_rect.centerx = SCREEN_WIDTH // 2 |
161 |
+ skip_rect.top = string_rect.bottom + 5 |
162 |
+ |
163 |
+ bg_rect = pygame.Rect(string_rect.left - 10, string_rect.top - 5, string_rect.width + 20, string_rect.height + skip_rect.height + 15) |
164 |
+--- a/lib/animation.py |
165 |
++++ b/lib/animation.py |
166 |
+@@ -58,9 +58,9 @@ |
167 |
+ self.finished = True |
168 |
+ else: |
169 |
+ self.i = 0 |
170 |
+- if Animation.cached_frames.has_key(self.cache_name + str(self.i)): |
171 |
++ if (self.cache_name + str(self.i)) in Animation.cached_frames: |
172 |
+ self.image = Animation.cached_frames[self.cache_name + str(self.i)] |
173 |
+ else: |
174 |
+ self.image = (self.frames[self.i]).get_image() |
175 |
+ Animation.cached_frames[self.cache_name + str(self.i)] = self.image |
176 |
+- return self.image |
177 |
+\ No newline at end of file |
178 |
++ return self.image |
179 |
+--- a/lib/edit_utils.py |
180 |
++++ b/lib/edit_utils.py |
181 |
+@@ -16,23 +16,23 @@ |
182 |
+ return |
183 |
+ |
184 |
+ def update(self, inputs): |
185 |
+- if inputs.has_key("REMOVE_TILE"): |
186 |
++ if "REMOVE_TILE" in inputs: |
187 |
+ return Change("remove", self.cursor) |
188 |
+- if inputs.has_key("ADD_TILE_WALL"): |
189 |
++ if "ADD_TILE_WALL" in inputs: |
190 |
+ return Change("W", self.cursor) |
191 |
+- if inputs.has_key("ADD_TILE_SPIKES"): |
192 |
++ if "ADD_TILE_SPIKES" in inputs: |
193 |
+ return Change("S", self.cursor) |
194 |
+- if inputs.has_key("ADD_TILE_BARS"): |
195 |
++ if "ADD_TILE_BARS" in inputs: |
196 |
+ return Change("B", self.cursor) |
197 |
+- if inputs.has_key("SAVE_TILES"): |
198 |
++ if "SAVE_TILES" in inputs: |
199 |
+ return Change("save", (0, 0)) |
200 |
+- if inputs.has_key("EDIT_RIGHT") and self.cursor[0] < (TILES_HOR - 1): |
201 |
++ if "EDIT_RIGHT" in inputs and self.cursor[0] < (TILES_HOR - 1): |
202 |
+ self.cursor[0] += 1 |
203 |
+- if inputs.has_key("EDIT_LEFT") and self.cursor[0] > 0: |
204 |
++ if "EDIT_LEFT" in inputs and self.cursor[0] > 0: |
205 |
+ self.cursor[0] -= 1 |
206 |
+- if inputs.has_key("EDIT_DOWN") and self.cursor[1] < (TILES_VER - 1): |
207 |
++ if "EDIT_DOWN" in inputs and self.cursor[1] < (TILES_VER - 1): |
208 |
+ self.cursor[1] += 1 |
209 |
+- if inputs.has_key("EDIT_UP") and self.cursor[1] > 0: |
210 |
++ if "EDIT_UP" in inputs and self.cursor[1] > 0: |
211 |
+ self.cursor[1] -= 1 |
212 |
+ return None |
213 |
+ |
214 |
+--- a/lib/game.py |
215 |
++++ b/lib/game.py |
216 |
+@@ -265,7 +265,7 @@ |
217 |
+ trigger = None |
218 |
+ |
219 |
+ if scripted_event_on: |
220 |
+- if inputs.has_key("JUMP") or inputs.has_key("DOWN"): |
221 |
++ if "JUMP" in inputs or "DOWN" in inputs: |
222 |
+ cleared = True |
223 |
+ |
224 |
+ moved = False |
225 |
+@@ -277,20 +277,20 @@ |
226 |
+ #There isn't anything special going on: player can control the character |
227 |
+ #Translates input to commands to the player object |
228 |
+ add_time = True |
229 |
+- if inputs.has_key("LEFT"): |
230 |
++ if "LEFT" in inputs: |
231 |
+ player.move((-PLAYER_MAX_ACC, 0)) |
232 |
+ moved = True |
233 |
+ |
234 |
+- if inputs.has_key("RIGHT"): |
235 |
++ if "RIGHT" in inputs: |
236 |
+ player.move((PLAYER_MAX_ACC, 0)) |
237 |
+ moved = True |
238 |
+ |
239 |
+- if inputs.has_key("JUMP"): |
240 |
++ if "JUMP" in inputs: |
241 |
+ if (player.on_ground): |
242 |
+ count = 0 |
243 |
+ while (count < 5): |
244 |
+ count += 1 |
245 |
+- particles.append(Particle(screen, 10, player.rect.centerx - player.dx / 4 + random.uniform(-3, 3), player.rect.bottom, -player.dx * 0.1, -0.5, 0.3, level.dust_color, 4)) |
246 |
++ particles.append(Particle(screen, 10, player.rect.centerx - player.dx // 4 + random.uniform(-3, 3), player.rect.bottom, -player.dx * 0.1, -0.5, 0.3, level.dust_color, 4)) |
247 |
+ player.jump() |
248 |
+ |
249 |
+ #The blobs always try to jump when the player jumps |
250 |
+@@ -299,10 +299,10 @@ |
251 |
+ if o.itemclass == "blob": |
252 |
+ o.jump() |
253 |
+ |
254 |
+- if inputs.has_key("UP") and not player.on_ground: |
255 |
++ if "UP" in inputs and not player.on_ground: |
256 |
+ player.jump() |
257 |
+ |
258 |
+- if inputs.has_key("DOWN"): |
259 |
++ if "DOWN" in inputs: |
260 |
+ pick_up_item = level.pick_up(player.x, player.y) |
261 |
+ if pick_up_item != None: |
262 |
+ play_sound("coins") |
263 |
+@@ -314,10 +314,10 @@ |
264 |
+ trigger = level.trigger(player.x, player.y) |
265 |
+ |
266 |
+ #Debug command for flipping: |
267 |
+- if inputs.has_key("SPECIAL"): |
268 |
++ if "SPECIAL" in inputs: |
269 |
+ trigger = Trigger(TRIGGER_FLIP, player.x, player.y) |
270 |
+ |
271 |
+- if inputs.has_key("PAUSE") and player.current_animation != "dying": |
272 |
++ if "PAUSE" in inputs and player.current_animation != "dying": |
273 |
+ paused = not paused |
274 |
+ |
275 |
+ #Decelerates the player, if he doesn't press any movement keys or when he is dead and on the ground |
276 |
+@@ -344,7 +344,7 @@ |
277 |
+ #Dust effect rising from the character's feet: |
278 |
+ |
279 |
+ if (player.current_animation == "walking"): |
280 |
+- particles.append(Particle(screen, 10, player.rect.centerx - player.dx / 2 + random.uniform(-2, 2), player.rect.bottom, -player.dx * 0.1, 0.1, 0.3, level.dust_color)) |
281 |
++ particles.append(Particle(screen, 10, player.rect.centerx - player.dx // 2 + random.uniform(-2, 2), player.rect.bottom, -player.dx * 0.1, 0.1, 0.3, level.dust_color)) |
282 |
+ |
283 |
+ #Updating level and objects: |
284 |
+ |
285 |
+@@ -455,7 +455,7 @@ |
286 |
+ player.orientation = current_scripted_event_element.orientation |
287 |
+ current_scripted_event_element.finished = True |
288 |
+ elif current_scripted_event_element.event_type == "change_level": |
289 |
+- score.score += (5 + score_mod) * ((player.life + 4) / 5 + 12) |
290 |
++ score.score += (5 + score_mod) * ((player.life + 4) // 5 + 12) |
291 |
+ score.levels += 1 |
292 |
+ current_scripted_event_element.finished = True |
293 |
+ if player.current_animation != "gone": |
294 |
+--- a/lib/level.py |
295 |
++++ b/lib/level.py |
296 |
+@@ -129,8 +129,8 @@ |
297 |
+ self.bg_animations["default"] = Animation(self.set + "_background", "static") |
298 |
+ self.current_animation = "default" |
299 |
+ self.rect = (self.bg_animations[self.current_animation].update_and_get_image()).get_rect() |
300 |
+- self.rect.centerx = SCREEN_WIDTH / 2 |
301 |
+- self.rect.centery = SCREEN_HEIGHT / 2 |
302 |
++ self.rect.centerx = SCREEN_WIDTH // 2 |
303 |
++ self.rect.centery = SCREEN_HEIGHT // 2 |
304 |
+ |
305 |
+ self.reset_active_tiles() |
306 |
+ return |
307 |
+@@ -217,7 +217,7 @@ |
308 |
+ |
309 |
+ #Checks the point for solid ground |
310 |
+ def ground_check(self, x, y): |
311 |
+- if self.cached_ground_check.has_key(str(x) + "_" + str(y)): |
312 |
++ if (str(x) + "_" + str(y)) in self.cached_ground_check: |
313 |
+ return self.cached_ground_check[str(x) + "_" + str(y)] |
314 |
+ else: |
315 |
+ if x > SCREEN_WIDTH or y > SCREEN_HEIGHT or x < 0 or y < 0: |
316 |
+@@ -333,7 +333,7 @@ |
317 |
+ def remove_tile(self, coords): |
318 |
+ """Remove a tile from the level with coordinates relative to the corner of the area currently visible.""" |
319 |
+ for t in self.active_tiles: |
320 |
+- if t.rect.collidepoint(coords[0]*TILE_DIM + TILE_DIM / 2, coords[1]*TILE_DIM + TILE_DIM / 2): |
321 |
++ if t.rect.collidepoint(coords[0]*TILE_DIM + TILE_DIM // 2, coords[1]*TILE_DIM + TILE_DIM // 2): |
322 |
+ self.active_tiles.remove(t) |
323 |
+ self.tiles.remove(t) |
324 |
+ self.edited = True |
325 |
+--- a/lib/log.py |
326 |
++++ b/lib/log.py |
327 |
+@@ -15,7 +15,7 @@ |
328 |
+ """Add a message to the message log, which can be written on disk later.""" |
329 |
+ |
330 |
+ #Multiple messages of the same type aren't added to the log: |
331 |
+- if Variables.vdict.has_key("last_log_message"): |
332 |
++ if "last_log_message" in Variables.vdict: |
333 |
+ if string == Variables.vdict["last_log_message"]: |
334 |
+ return |
335 |
+ |
336 |
+@@ -24,9 +24,9 @@ |
337 |
+ |
338 |
+ Variables.vdict["last_log_message"] = string |
339 |
+ |
340 |
+- if Variables.vdict.has_key("log"): |
341 |
++ if "log" in Variables.vdict: |
342 |
+ Variables.vdict["log"] = string + "\n" + Variables.vdict["log"] |
343 |
+ else: |
344 |
+ Variables.vdict["log"] = string |
345 |
+ |
346 |
+- return |
347 |
+\ No newline at end of file |
348 |
++ return |
349 |
+--- a/lib/sound.py |
350 |
++++ b/lib/sound.py |
351 |
+@@ -25,7 +25,7 @@ |
352 |
+ if not Variables.vdict["sound"]: |
353 |
+ return |
354 |
+ snd = None |
355 |
+- if (not sounds.has_key(sound_id)): |
356 |
++ if sound_id not in sounds: |
357 |
+ try: |
358 |
+ sound_path = data.filepath(os.path.join("sounds", sound_id + ".ogg")) |
359 |
+ snd = sounds[sound_id] = pygame.mixer.Sound(sound_path) |
360 |
+--- a/lib/visibleobject.py |
361 |
++++ b/lib/visibleobject.py |
362 |
+@@ -27,9 +27,9 @@ |
363 |
+ self.x = x |
364 |
+ self.y = y |
365 |
+ if (self.x == None): |
366 |
+- self.x = SCREEN_WIDTH / 2 |
367 |
++ self.x = SCREEN_WIDTH // 2 |
368 |
+ if (self.y == None): |
369 |
+- self.y = SCREEN_HEIGHT / 2 |
370 |
++ self.y = SCREEN_HEIGHT // 2 |
371 |
+ |
372 |
+ self.flipping = False |
373 |
+ self.flipcounter = 0 |
374 |
+@@ -122,7 +122,7 @@ |
375 |
+ |
376 |
+ def die(self): |
377 |
+ """Make the object die - if the object has a death animation, it will be played first.""" |
378 |
+- if self.animations.has_key("dying"): |
379 |
++ if "dying" in self.animations: |
380 |
+ self.current_animation = "dying" |
381 |
+ else: |
382 |
+ self.dead = True |
383 |
+--- a/lib/player.py |
384 |
++++ b/lib/player.py |
385 |
+@@ -79,7 +79,7 @@ |
386 |
+ |
387 |
+ blood = [] |
388 |
+ |
389 |
+- if collision_type > 0: |
390 |
++ if collision_type and collision_type > 0: |
391 |
+ blood = self.take_damage(collision_type) |
392 |
+ if self.current_animation != "dying": |
393 |
+ self.dy -= collision_type*PLAYER_JUMP_ACC / 4.5 |
394 |
+--- a/lib/object.py |
395 |
++++ b/lib/object.py |
396 |
+@@ -34,7 +34,7 @@ |
397 |
+ self.initial_y = y |
398 |
+ self.gravity = gravity |
399 |
+ self.colliding = colliding |
400 |
+- self.active = (self.x + self.rect.width / 2 > 0) and (self.y + self.rect.height / 2 > 0) |
401 |
++ self.active = (self.x + self.rect.width // 2 > 0) and (self.y + self.rect.height // 2 > 0) |
402 |
+ |
403 |
+ self.on_ground = False |
404 |
+ |
405 |
+@@ -76,7 +76,7 @@ |
406 |
+ VisibleObject.update(self) |
407 |
+ |
408 |
+ if self.flip_finished and self.itemclass != "player": |
409 |
+- self.active = (self.x + self.rect.width / 2 > 0) and (self.y + self.rect.height / 2 > 0) |
410 |
++ self.active = (self.x + self.rect.width // 2 > 0) and (self.y + self.rect.height // 2 > 0) |
411 |
+ |
412 |
+ if self.flipping: |
413 |
+ return |
414 |
+@@ -101,9 +101,9 @@ |
415 |
+ """Make the object flip with the level to either direction""" |
416 |
+ if VisibleObject.flip(self, flip_direction): |
417 |
+ if flip_direction == CLOCKWISE: |
418 |
+- self.initial_x, self.initial_y = -self.initial_y + PLAY_AREA_WIDTH / TILES_HOR * (TILES_HOR*2 - FULL_TILES_HOR), self.initial_x |
419 |
++ self.initial_x, self.initial_y = -self.initial_y + PLAY_AREA_WIDTH // TILES_HOR * (TILES_HOR*2 - FULL_TILES_HOR), self.initial_x |
420 |
+ else: |
421 |
+- self.initial_x, self.initial_y = self.initial_y, -self.initial_x + PLAY_AREA_WIDTH / TILES_HOR * (TILES_HOR*2 - FULL_TILES_HOR) |
422 |
++ self.initial_x, self.initial_y = self.initial_y, -self.initial_x + PLAY_AREA_WIDTH // TILES_HOR * (TILES_HOR*2 - FULL_TILES_HOR) |
423 |
+ return |
424 |
+ |
425 |
+ def check_collisions(self, level): |
426 |
+@@ -116,25 +116,25 @@ |
427 |
+ |
428 |
+ self.on_ground = False |
429 |
+ |
430 |
+- if self.x < 0 + self.rect.width / 2: |
431 |
+- self.x = 0 + self.rect.width / 2 |
432 |
++ if self.x < 0 + self.rect.width // 2: |
433 |
++ self.x = 0 + self.rect.width // 2 |
434 |
+ self.dx = 0 |
435 |
+ collision_type = 0 |
436 |
+ |
437 |
+- if self.x > PLAY_AREA_WIDTH - self.rect.width / 2: |
438 |
+- self.x = PLAY_AREA_WIDTH - self.rect.width / 2 |
439 |
++ if self.x > PLAY_AREA_WIDTH - self.rect.width // 2: |
440 |
++ self.x = PLAY_AREA_WIDTH - self.rect.width // 2 |
441 |
+ self.dx = 0 |
442 |
+ collision_type = 0 |
443 |
+ |
444 |
+ # The commented block is the collision code for the upper edge of the screen. |
445 |
+ # The spiders and projectiles might need this, but they use simplified |
446 |
+ # collision detection for better performance anyway. |
447 |
+- '''if self.y < 0 + self.rect.height / 2: |
448 |
+- self.y = 0 + self.rect.height / 2 |
449 |
++ '''if self.y < 0 + self.rect.height // 2: |
450 |
++ self.y = 0 + self.rect.height // 2 |
451 |
+ self.dy = 0''' |
452 |
+ |
453 |
+- if self.y > PLAY_AREA_HEIGHT - self.rect.height / 2: |
454 |
+- self.y = PLAY_AREA_HEIGHT - self.rect.height / 2 |
455 |
++ if self.y > PLAY_AREA_HEIGHT - self.rect.height // 2: |
456 |
++ self.y = PLAY_AREA_HEIGHT - self.rect.height // 2 |
457 |
+ self.dy = 0 |
458 |
+ self.on_ground = True |
459 |
+ collision_type = 0 |
460 |
+--- a/lib/locals.py |
461 |
++++ b/lib/locals.py |
462 |
+@@ -16,8 +16,8 @@ |
463 |
+ |
464 |
+ TILE_DIM = 40 |
465 |
+ |
466 |
+-PLAY_AREA_CENTER_X = (-FULL_TILES_HOR / 2 + TILES_HOR) * TILE_DIM |
467 |
+-PLAY_AREA_CENTER_Y = (-FULL_TILES_VER / 2 + TILES_VER) * TILE_DIM |
468 |
++PLAY_AREA_CENTER_X = (-FULL_TILES_HOR // 2 + TILES_HOR) * TILE_DIM |
469 |
++PLAY_AREA_CENTER_Y = (-FULL_TILES_VER // 2 + TILES_VER) * TILE_DIM |
470 |
+ |
471 |
+ GRAVITY = 1.0 |
472 |
+ GRAVITY_PARTICLE = 0.5 |
473 |
+--- a/lib/mainmenu.py |
474 |
++++ b/lib/mainmenu.py |
475 |
+@@ -73,19 +73,19 @@ |
476 |
+ |
477 |
+ menu_image = render_text("World " + str(self.world.number) + ": " + self.world.name, COLOR_GUI) |
478 |
+ rect = menu_image.get_rect() |
479 |
+- rect.centerx = SCREEN_WIDTH / 2 |
480 |
++ rect.centerx = SCREEN_WIDTH // 2 |
481 |
+ rect.top = GUI_MENU_TOP - 75 |
482 |
+ self.bgscreen.blit(menu_image, rect) |
483 |
+ |
484 |
+ menu_image = render_text(score_text, COLOR_GUI) |
485 |
+ rect = menu_image.get_rect() |
486 |
+- rect.centerx = SCREEN_WIDTH / 2 |
487 |
++ rect.centerx = SCREEN_WIDTH // 2 |
488 |
+ rect.top = GUI_MENU_TOP - 50 |
489 |
+ self.bgscreen.blit(menu_image, rect) |
490 |
+ |
491 |
+ menu_image = render_text(time_text, COLOR_GUI) |
492 |
+ rect = menu_image.get_rect() |
493 |
+- rect.centerx = SCREEN_WIDTH / 2 |
494 |
++ rect.centerx = SCREEN_WIDTH // 2 |
495 |
+ rect.top = GUI_MENU_TOP - 30 |
496 |
+ self.bgscreen.blit(menu_image, rect) |
497 |
+ |
498 |
+--- a/lib/menu.py |
499 |
++++ b/lib/menu.py |
500 |
+@@ -91,14 +91,14 @@ |
501 |
+ |
502 |
+ menu_bg = pygame.image.load(data.picpath("menu", "bg")).convert_alpha() |
503 |
+ rect = menu_bg.get_rect() |
504 |
+- rect.centerx = SCREEN_WIDTH / 2 |
505 |
++ rect.centerx = SCREEN_WIDTH // 2 |
506 |
+ rect.top = GUI_MENU_TOP |
507 |
+ self.screen.blit(menu_bg, rect) |
508 |
+ |
509 |
+ if self.heading_text != None: |
510 |
+ menu_head = render_text(self.heading_text) |
511 |
+ rect = menu_head.get_rect() |
512 |
+- rect.centerx = SCREEN_WIDTH / 2 |
513 |
++ rect.centerx = SCREEN_WIDTH // 2 |
514 |
+ rect.top = GUI_MENU_TOP + 50 + menu_offset |
515 |
+ self.screen.blit(menu_head, rect) |
516 |
+ |
517 |
+@@ -120,7 +120,7 @@ |
518 |
+ else: |
519 |
+ menu_image = render_text(m, COLOR_GUI) |
520 |
+ rect = menu_image.get_rect() |
521 |
+- rect.centerx = SCREEN_WIDTH / 2 |
522 |
++ rect.centerx = SCREEN_WIDTH // 2 |
523 |
+ rect.top = GUI_MENU_TOP + 60 + (menu_visible + 1) * 20 + menu_offset |
524 |
+ self.screen.blit(menu_image, rect) |
525 |
+ current_menu_index += 1 |
526 |
+--- a/lib/particle.py |
527 |
++++ b/lib/particle.py |
528 |
+@@ -28,9 +28,9 @@ |
529 |
+ self.radius = radius |
530 |
+ self.gravity = gravity |
531 |
+ if (self.x == None): |
532 |
+- self.x = SCREEN_WIDTH / 2 |
533 |
++ self.x = SCREEN_WIDTH // 2 |
534 |
+ if (self.y == None): |
535 |
+- self.y = SCREEN_HEIGHT / 2 |
536 |
++ self.y = SCREEN_HEIGHT // 2 |
537 |
+ if (self.dx == None): |
538 |
+ self.dx = 0.0 |
539 |
+ if (self.dy == None): |
540 |
+--- a/lib/tile.py |
541 |
++++ b/lib/tile.py |
542 |
+@@ -47,8 +47,8 @@ |
543 |
+ def realign(self): |
544 |
+ self.rect.centerx = self.x |
545 |
+ self.rect.centery = self.y |
546 |
+- self.x = round((float(self.rect.right)/float(TILE_DIM)), 0)*TILE_DIM - self.rect.width / 2 |
547 |
+- self.y = round((float(self.rect.bottom)/float(TILE_DIM)), 0)*TILE_DIM - self.rect.height / 2 |
548 |
++ self.x = round((float(self.rect.right)/float(TILE_DIM)), 0)*TILE_DIM - self.rect.width // 2 |
549 |
++ self.y = round((float(self.rect.bottom)/float(TILE_DIM)), 0)*TILE_DIM - self.rect.height // 2 |
550 |
+ if self.rect.height % 2 == 1: |
551 |
+ self.y -= 1 |
552 |
+ if self.rect.width % 2 == 1: |
553 |
|
554 |
diff --git a/games-arcade/whichwayisup/whichwayisup-0.7.9-r3.ebuild b/games-arcade/whichwayisup/whichwayisup-0.7.9-r3.ebuild |
555 |
new file mode 100644 |
556 |
index 00000000000..0644c6c31c3 |
557 |
--- /dev/null |
558 |
+++ b/games-arcade/whichwayisup/whichwayisup-0.7.9-r3.ebuild |
559 |
@@ -0,0 +1,62 @@ |
560 |
+# Copyright 1999-2019 Gentoo Authors |
561 |
+# Distributed under the terms of the GNU General Public License v2 |
562 |
+ |
563 |
+EAPI=7 |
564 |
+PYTHON_COMPAT=( python3_{6,7,8} ) |
565 |
+ |
566 |
+inherit desktop python-r1 |
567 |
+ |
568 |
+MY_PV="${PV//./}" |
569 |
+MY_P="${PN}_b${MY_PV}" |
570 |
+ |
571 |
+DESCRIPTION="A traditional and challenging 2D platformer game with a slight rotational twist" |
572 |
+HOMEPAGE="http://hectigo.net/puskutraktori/whichwayisup/" |
573 |
+SRC_URI="http://hectigo.net/puskutraktori/whichwayisup/${MY_P}.zip" |
574 |
+ |
575 |
+LICENSE="GPL-2 CC-BY-3.0" |
576 |
+SLOT="0" |
577 |
+KEYWORDS="~amd64 ~x86" |
578 |
+ |
579 |
+IUSE="" |
580 |
+REQUIRED_USE="${PYTHON_REQUIRED_USE}" |
581 |
+ |
582 |
+RDEPEND="${PYTHON_DEPS} |
583 |
+ dev-python/pygame[${PYTHON_USEDEP}] |
584 |
+" |
585 |
+DEPEND="${RDEPEND}" |
586 |
+BDEPEND="app-arch/unzip" |
587 |
+ |
588 |
+S="${WORKDIR}/${PN}" |
589 |
+ |
590 |
+PATCHES=( |
591 |
+ # Fixes from Fedora |
592 |
+ "${FILESDIR}"/${P}-check_for_joystick_axes_not_null.patch |
593 |
+ "${FILESDIR}"/${P}-initialize_only_required_pygame_modules.patch |
594 |
+ "${FILESDIR}"/${P}-python3.patch |
595 |
+) |
596 |
+ |
597 |
+src_prepare() { |
598 |
+ default |
599 |
+ sed -i \ |
600 |
+ -e "s:libdir\ =\ .*:libdir\ =\ \"/usr/$(get_libdir)/${PN}\":" \ |
601 |
+ run_game.py || die |
602 |
+ sed -i \ |
603 |
+ -e "s:data_dir\ =\ .*:data_dir\ =\ \"/usr/share/${PN}\":" \ |
604 |
+ lib/data.py || die |
605 |
+ rm data/pictures/Thumbs.db || die |
606 |
+} |
607 |
+ |
608 |
+src_install() { |
609 |
+ newbin run_game.py ${PN} |
610 |
+ |
611 |
+ insinto "/usr/$(get_libdir)/${PN}" |
612 |
+ doins lib/*.py |
613 |
+ |
614 |
+ einstalldocs |
615 |
+ |
616 |
+ insinto "/usr/share/${PN}" |
617 |
+ doins -r data/* |
618 |
+ |
619 |
+ newicon "${FILESDIR}"/${PN}-32.xpm ${PN}.xpm |
620 |
+ make_desktop_entry ${PN} "Which Way Is Up?" |
621 |
+} |