Thanks for your feedbacks, guys.
As Sik mentionned, this intro is mainly made using a table of sprites, with a separate table of attributes to tell them, individually, when to remain behind the logo's layer.
The sin/cos was the fun part indeed. You might find interesting (or not at all) that the cos/sin tables are mainly precalculated, using a piece of Python code :
Code: Select all
# Classic lissajou
def traj0x(a):
traj_x_amplitude = 128
return scr_x_center + int(traj_x_amplitude * math.cos(3.0 * a * math.pi / (rotation_steps / 4.0)))
def traj0y(a):
traj_y_amplitude = 64
return scr_y_center + int(traj_y_amplitude * math.sin(2.0 * a * math.pi / (rotation_steps / 4.0)))
# Pseudo bouncing
def bounce0x(a):
a *= 2.0
traj_x_amplitude = 128
return scr_x_center + int(traj_x_amplitude * math.cos(a * math.pi / (rotation_steps / 4.0)))
def bounce0y(a):
s0 = traj0y(a)
a *= 2.0
a += (math.pi * 0.353857)
traj_y_amplitude = 64
s = math.sin(2.0 * a * math.pi / (rotation_steps / 4.0))
s *= 1.0 - ((1.0 + math.cos(8.0 * a * math.pi / (rotation_steps / 4.0))) * 0.05)
s = 1.0 - abs(s)
s = 2.0 * (s - 0.5)
s *= (traj_y_amplitude * 1.45)
s -= 4
s = scr_y_center + s
s = (s + s0) * 0.5
return int(s)
# Alternate Lissajou
def traj1x(a):
traj_x_amplitude = 128
return scr_x_center + int(traj_x_amplitude * math.sin(2.0 * a * math.pi / (rotation_steps / 4.0)))
def traj1y(a):
traj_y_amplitude = 64
return scr_y_center + int(traj_y_amplitude * math.cos(5.0 * a * math.pi / (rotation_steps / 4.0)))
# Alternate Lissajou 2
def traj2x(a):
traj_x_amplitude = 128
s0 = traj_x_amplitude * math.sin(2.0 * a * math.pi / (rotation_steps / 4.0))
s1 = traj_x_amplitude * math.cos(9.0 * a * math.pi / (rotation_steps / 4.0))
s = 0.75 * s0 + 0.25 * s1
return scr_x_center + int(s)
def traj2y(a):
traj_y_amplitude = 64
s0 = traj_y_amplitude * math.cos(5.0 * a * math.pi / (rotation_steps / 4.0))
s1 = traj_y_amplitude * math.sin(1.0 * a * math.pi / (rotation_steps / 4.0))
s = 0.8 * s0 + 0.2 * s1
s *= 1.15
s += 4
return scr_y_center + int(s)
640 polygons are enough for everyone.