From ae5518d8e1dafee60d388b5afad247ec9a84d4ee Mon Sep 17 00:00:00 2001 From: Einar Forselv Date: Fri, 28 Mar 2025 23:13:50 +0100 Subject: [PATCH 1/4] Increase resolution to 720p --- arcade/examples/procedural_caves_bsp.py | 4 ++-- arcade/examples/procedural_caves_cellular.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/arcade/examples/procedural_caves_bsp.py b/arcade/examples/procedural_caves_bsp.py index 8efb0f578a..fe6d05c196 100644 --- a/arcade/examples/procedural_caves_bsp.py +++ b/arcade/examples/procedural_caves_bsp.py @@ -37,8 +37,8 @@ VIEWPORT_MARGIN = 300 # How big the window is -WINDOW_WIDTH = 800 -WINDOW_HEIGHT = 600 +WINDOW_WIDTH = 1280 +WINDOW_HEIGHT = 720 WINDOW_TITLE = "Procedural Caves BSP Example" MERGE_SPRITES = False diff --git a/arcade/examples/procedural_caves_cellular.py b/arcade/examples/procedural_caves_cellular.py index 6ed1bd22ef..bb773f9171 100644 --- a/arcade/examples/procedural_caves_cellular.py +++ b/arcade/examples/procedural_caves_cellular.py @@ -35,8 +35,8 @@ VIEWPORT_MARGIN = 300 # How big the window is -WINDOW_WIDTH = 800 -WINDOW_HEIGHT = 600 +WINDOW_WIDTH = 1280 +WINDOW_HEIGHT = 720 WINDOW_TITLE = "Procedural Caves Cellular Automata Example" # How fast the camera pans to the player. 1.0 is instant. From 264e93118336dd81f0316f403e961a365b3a4ad4 Mon Sep 17 00:00:00 2001 From: Einar Forselv Date: Fri, 28 Mar 2025 23:14:17 +0100 Subject: [PATCH 2/4] Remove excessive debug prints --- arcade/examples/perspective.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arcade/examples/perspective.py b/arcade/examples/perspective.py index 315218a5b4..6c40865207 100644 --- a/arcade/examples/perspective.py +++ b/arcade/examples/perspective.py @@ -123,7 +123,7 @@ def on_update(self, delta_time: float): (1.0, 0.0, 0.0), (0, 0, 3), 180 * self.window.time ) view_data.forward, view_data.up = arcade.camera.grips.look_at(view_data, (0.0, 0.0, 0.0)) - print(view_data) + # print(view_data) def on_draw(self): From a2d23efd056ce83c9fb35cebc00f558d828f8035 Mon Sep 17 00:00:00 2001 From: Einar Forselv Date: Fri, 28 Mar 2025 23:14:37 +0100 Subject: [PATCH 3/4] Update animal facts api to v2 --- arcade/examples/net_process_animal_facts.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/arcade/examples/net_process_animal_facts.py b/arcade/examples/net_process_animal_facts.py index 1e4c1e351b..08a4d543be 100644 --- a/arcade/examples/net_process_animal_facts.py +++ b/arcade/examples/net_process_animal_facts.py @@ -207,7 +207,8 @@ def do_work(self, in_queue, out_queue): out_queue.put(selected_type.get_fact()) out_queue.put(selected_type.get_image()) except Exception as e: - print("Error:", e) + import traceback + traceback.print_exc() def start(self) -> int: """Start the process and wait for it to be ready""" @@ -229,11 +230,12 @@ def get_image(self) -> arcade.Texture: class CatFacts(Facts): - """Get random cat facts and iamges""" + """Get random cat facts and images""" def get_fact(self) -> str: with urllib.request.urlopen("https://meowfacts.herokuapp.com") as fd: data = json.loads(fd.read().decode("utf-8")) + print(data) return data["data"][0] def get_image(self) -> arcade.Texture: @@ -254,9 +256,10 @@ def __init__(self): self.images = [i for i in self.images if not i.endswith(".mp4")] def get_fact(self) -> str: - with urllib.request.urlopen("http://dog-api.kinduff.com/api/facts") as fd: + with urllib.request.urlopen("https://dogapi.dog/api/v2/facts") as fd: data = json.loads(fd.read().decode("utf-8")) - return data["facts"][0] + print(data) + return data["data"][0]["attributes"]["body"] def get_image(self) -> arcade.Texture: """Get a random dog image from https://random.dog""" From 77616e6e2db915cf00ea3e68f2dfa7882ced0565 Mon Sep 17 00:00:00 2001 From: Einar Forselv Date: Fri, 28 Mar 2025 23:28:46 +0100 Subject: [PATCH 4/4] Derp --- arcade/examples/net_process_animal_facts.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arcade/examples/net_process_animal_facts.py b/arcade/examples/net_process_animal_facts.py index 08a4d543be..cd6e32582f 100644 --- a/arcade/examples/net_process_animal_facts.py +++ b/arcade/examples/net_process_animal_facts.py @@ -30,6 +30,7 @@ """ import PIL.Image import random +import traceback import time import json import urllib.request @@ -206,8 +207,7 @@ def do_work(self, in_queue, out_queue): try: out_queue.put(selected_type.get_fact()) out_queue.put(selected_type.get_image()) - except Exception as e: - import traceback + except Exception: traceback.print_exc() def start(self) -> int: