diff --git a/arcade/examples/net_process_animal_facts.py b/arcade/examples/net_process_animal_facts.py index 1e4c1e351b..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,8 @@ 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: - print("Error:", e) + except Exception: + 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""" 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): 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.