gb-tarot/generate_animation_circling.py

23 lines
572 B
Python

#!python3
from math import *
tile_size = 8
frames = []
center = (100, 64)
spread_max = 8
spread_min = 4
frame_count = 255
for t in range(frame_count):
e = ((spread_min + spread_max)/2) + (spread_max - spread_min)*0.5*sin(2*pi*t/frame_count)
x = center[0] - 60*cos(2*pi*t/frame_count) - (e*1.5) - (tile_size*1.5)
y = center[1] - (e * 1.5) - (tile_size*3)
frames.append( (x, y, e) )
def h(flt):
return f'${int(floor(flt+0.5)):x}'
frame_strings = [f"{h(t[1])}, {h(t[0])}, {h(t[2])}" for t in frames]
print("db {}, {}".format(frame_count, ", ".join(frame_strings)))