Merge branch 'new-anim'
This commit is contained in:
commit
b020a9d18f
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -1,4 +1,4 @@
|
||||
from doodles import Polygon, Color
|
||||
from doodles import Polygon
|
||||
import random
|
||||
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user