home *** CD-ROM | disk | FTP | other *** search
- global iteration, ax, bx, cx, ay, by, cy, x1, x2, x3, x4, y1, y2, y3, y4, w, h
-
- on Bezanimate channel
- set iteration to iteration + 1
- if iteration = 51 then
- set iteration to 0
- updatelines()
- end if
- set t1 to float(iteration / 50.0)
- set t2 to float(t1 * t1)
- set t3 to float(t2 * t1)
- set the locH of sprite channel to integer((ax * t3) + (bx * t2) + (cx * t1) + x1)
- set the locV of sprite channel to integer((ay * t3) + (by * t2) + (cy * t1) + y1)
- end
-
- on BezInit channel
- set w to the width of sprite channel
- set h to the width of sprite channel
- set x to random(640)
- set Y to random(480)
- set x1 to min(max((w / 2) + 20, x), 620 - (w / 2))
- set y1 to min(max((h / 2) + 20, Y), 460 - (w / 2))
- set x2 to x1 + (random(50) * getAt([1, -1], random(2)))
- set y2 to y1 + (random(50) * getAt([1, -1], random(2)))
- set x to random(640)
- set Y to random(480)
- set x4 to min(max((w / 2) + 20, x), 620 - (w / 2))
- set y4 to min(max((h / 2) + 20, Y), 460 - (w / 2))
- set x3 to x1 + (random(50) * getAt([1, -1], random(2)))
- set y3 to y1 + (random(50) * getAt([1, -1], random(2)))
- set cx to 3 * (x2 - x1)
- set cy to 3 * (y2 - y1)
- set bx to (3 * (x3 - x2)) - cx
- set by to (3 * (y3 - y2)) - cy
- set ax to x4 - x1 - cx - bx
- set ay to y4 - y1 - cy - by
- end
-
- on updatelines
- set x1 to x4
- set y1 to y4
- set x2 to x3
- set y2 to y3
- set x4 to min(max((w / 2) + 20, random(640)), 620 - (w / 2))
- set y4 to min(max((h / 2) + 20, random(480)), 460 - (w / 2))
- set x3 to x4 + (random(50) * getAt([1, -1], random(2)))
- set y3 to y4 + (random(50) * getAt([1, -1], random(2)))
- set cx to 3 * (x2 - x1)
- set cy to 3 * (y2 - y1)
- set bx to (3 * (x3 - x2)) - cx
- set by to (3 * (y3 - y2)) - cy
- set ax to x4 - x1 - cx - bx
- set ay to y4 - y1 - cy - by
- end
-