This commit is contained in:
James Turk 2024-04-30 21:26:21 -05:00
parent 2bf6e352ec
commit 21f897b397
5 changed files with 8 additions and 8 deletions

View File

@ -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)

View File

@ -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)

View File

@ -1,4 +1,4 @@
from doodles import Polygon, Color
from doodles import Polygon
import random

View File

@ -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

View File

@ -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