Start - animated title graphics

TOPICS: reveal alteration

Previously we had a mouse without a nose. We'll add a nose and a tongue as a child sprite of the head sprite. We do this as part of the "having" clause using "children". Notice that we don't need to explicitly launch child sprites if they are defined as children.

We are going to slide the tongue out of the mouse using a "reveal" alteration at a half second delay. Since we don't want the tongue visible until it comes out of the mouse, we'll set its transparency to 100% using alpha=0.

New code in red create sprite from title.png as TitleImg where x=0 y=0 end create sprite as Ring where center=340,340 end create sprite from clockFace.png as ClockFace where center=270,260 x=330 y=310 end create sprite from bigHand.png as BigHand where center=77,34 x=321 y=500 end create sprite from smallHand.png as SmallHand where center=90,26 x=254 y=509 end create sprite from title-speech-1.png as TitleSpeech1 where center=350,0 x=0 y=445 having alt=(sub create wait where delay=1000 completion=(sub create translation where x=368 easeout=30 speed=1200 end) end) end create sprite from title-speech-2.png as TitleSpeech2 where center=0,0 x=601 y=600 having alt=(sub create wait where delay=3000 completion=(sub create translation where x=235 easeout=30 speed=1200 end) end) alt=(sub create wait where delay=5000 completion=TitleMouse end) end create routine as Start launch TitleImg clone from Ring using original update sprite _clone where size=.5 and image="blueRing.png" and x=170 and y=120 insert into _clone where alt=(sub create rotation where speed=-40 end) clone from Ring using original update sprite _clone where size=.7 and image="redRing.png" and x=160 and y=590 insert into _clone where alt=(sub create rotation where speed=40 end) clone from Ring using original update sprite _clone where size=.6 and image="greenRing.png" and x=550 and y=350 insert into _clone where alt=(sub create rotation where speed=40 end) clone from Ring using original update sprite _clone where size=.2 and image="barRing.png" and x=500 and y=100 insert into _clone where alt=(sub create rotation where speed=-40 end) clone from Ring using original update sprite _clone where size=.35 and image="redRing.png" and x=200 and y=390 insert into _clone where alt=(sub create rotation where speed=40 end) clone from Ring using original update sprite _clone where size=.4 and image="greenRing.png" and x=550 and y=750 insert into _clone where alt=(sub create rotation where speed=40 end) launch ClockFace launch SmallHand launch BigHand launch TitleSpeech1 launch TitleSpeech2 end // ******************************************************** // TITLE MOUSE HEAD create routine as TitleMouse launch TitleMouseHead end create sprite from title-mouse-head.png as TitleMouseHead where center=111,98 x=300 y=300 size=0.1 having alt=(sub create scale where rate=5 until=1 completion=(sub create routine insert into ClockFace where alt=(sub create rotation where distance=30 speed=200 completion=(sub create rotation where distance=11 speed=-150 completion=(sub create rotation where distance=15 speed=150 end) end) end) end) end) children=(TitleMouseTongue,TitleMouseNose) alt=(sub create wait where delay=500 completion=MouseMischief end) end create sprite from nose-teeth.png as TitleMouseNose where center=17,21 x=2 y=55 end create sprite from tongue.png as TitleMouseTongue where center=15,0 x=-1 y=65 alpha=0 end create routine as MouseMischief update sprite TitleMouseTongue where alpha=1 insert into TitleMouseTongue where alt=(sub create reveal where direction="top" type="show" end) end

MouseMischief is a routine that is called by a "wait" alteration that is attached to TitleMouseHead. MouseMischief removes the transparency of the tongue using alpha=1 and immediately applies a "reveal" alteration. This alteration slides a sprite into view as if from behind an invisible wall.

Check back soon for the next part or follow on us Twitter


  March 11, 2016