Idle & Fadeout

This commit is contained in:
MaZderMind 2015-08-01 14:14:19 +02:00
parent c1d7cb6bee
commit db70531875
2 changed files with 38 additions and 8 deletions

View file

@ -18,11 +18,12 @@ def introFrames(parameters):
targets = {}
frames = 5*fps
maxdelay = 0
useddelay = 0
maxdelay = int(frames/2)
for tile in tiles:
delay = rnd.randint(0, frames)
maxdelay = max(maxdelay, delay)
delay = rnd.randint(0, maxdelay)
useddelay = max(useddelay, delay)
targets[tile] = (
# x/y
rnd.randint(-1200, -900),
@ -33,7 +34,7 @@ def introFrames(parameters):
)
# 5 Sekunde Kacheln zusammenbauen
for i in range(0, frames+maxdelay):
for i in range(0, frames+useddelay):
placements = []
for tile in tiles:
delay = targets[tile][2]
@ -110,6 +111,27 @@ def introFrames(parameters):
('rocket', 'attr', 'transform', 'translate(0, %.4f)' % y),
)
# stay there 1.5s + fill up flyin-delay
frames = 25+13 + maxdelay - useddelay
for i in range(0, frames):
yield (
('rocket', 'attr', 'transform', 'translate(0, 0)'),
)
# fade all out 0.5 s
frames = 12
for i in range(0, frames):
yield (
('fade', 'attr', 'x', '0'),
('fade', 'attr', 'y', '0'),
('fade', 'style', 'opacity', '%.4f' % easeLinear(i, 0, 1, frames)),
)
# final frame
yield (
('fade', 'style', 'opacity', '1'),
)
def outroFrames(p):
# 5 Sekunden stehen bleiben

View file

@ -25,11 +25,11 @@
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="0.49497475"
inkscape:cx="297.589"
inkscape:cy="610.74537"
inkscape:zoom="0.24748738"
inkscape:cx="1595.942"
inkscape:cy="478.88369"
inkscape:document-units="px"
inkscape:current-layer="layer1"
inkscape:current-layer="svg4309"
showgrid="false"
inkscape:window-width="1920"
inkscape:window-height="1014"
@ -1078,4 +1078,12 @@
</g>
</g>
</g>
<rect
style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#ff0000;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;enable-background:accumulate"
id="fade"
width="1920"
height="1080"
x="-3000"
y="1000"
inkscape:label="#rect3779" />
</svg>

Before

Width:  |  Height:  |  Size: 174 KiB

After

Width:  |  Height:  |  Size: 174 KiB