diff --git a/src/doodles/examples/clock.py b/src/doodles/examples/clock.py index acfe4a6..45649f5 100644 --- a/src/doodles/examples/clock.py +++ b/src/doodles/examples/clock.py @@ -1,4 +1,3 @@ -import time import math from doodles import Circle, Color, Line, Group @@ -27,5 +26,4 @@ def create(): # 200 # ).z(100) - l = Line(g).vec(0, 200).z(100).animate("degrees", lambda t: t % 60 / 60 * 360) - # l.animate("color", color_func) + Line(g).vec(0, 200).z(100).animate("degrees", lambda t: t % 60 / 60 * 360) diff --git a/src/doodles/examples/liskov.py b/src/doodles/examples/liskov.py index 6d2ecab..3d6769c 100644 --- a/src/doodles/examples/liskov.py +++ b/src/doodles/examples/liskov.py @@ -1,7 +1,7 @@ """ Demo of the interchangable nature of these classes. """ -from doodles import Polygon, Line, Rectangle, Circle, Color +from doodles import Polygon, Line, Rectangle, Circle import random import math @@ -22,4 +22,6 @@ def rainbow(t) -> tuple[int, int, int]: def create(): for _ in range(100): DoodleType = random.choice(types) - doodle = DoodleType().random().animate("color", rainbow) + d = DoodleType() + # we do not need to know what DoodleType is, these methods all work + d.random().animate("color", rainbow) diff --git a/src/doodles/examples/polygons.py b/src/doodles/examples/polygons.py index 6430b27..154c87e 100644 --- a/src/doodles/examples/polygons.py +++ b/src/doodles/examples/polygons.py @@ -1,4 +1,4 @@ -from doodles import Polygon, Color +from doodles import Polygon import random diff --git a/src/doodles/lines.py b/src/doodles/lines.py index 623c276..dd68427 100644 --- a/src/doodles/lines.py +++ b/src/doodles/lines.py @@ -6,7 +6,7 @@ the easiest to learn from. """ import math import random -from typing import Callable, Self +from typing import Self from .doodles import Doodle from .world import world diff --git a/src/doodles/world.py b/src/doodles/world.py index 9b43d9a..9ea1c7d 100644 --- a/src/doodles/world.py +++ b/src/doodles/world.py @@ -12,7 +12,7 @@ from .draw_engine import DrawEngine # this is needed because of circular references if TYPE_CHECKING: from .doodles import Doodle - from .shapes import Rectangle, Circle + from .shapes import Rectangle, Circle, Polygon from .lines import Line from .text import Text