Game Development Reference
In-Depth Information
jump:{
frames:[6, 7, 8, 9, 10],
speed:.5
}
}
The
next
property lets you define an animation that should play at the end of the frame cycle. In this example, the sprite
will play its
run
sequence, then play
jump
. The
speed
property was set on both animations to control the speed in which the
animation will play. By setting it to
.5
, the animations will play at half the speed of the Ticker's current FPS playback.
Let's get into a working example. Before adding and playing an animated sprite to the stage, you need to create
the animation's frames and its corresponding data. An excellent tool for creating animation is Flash, which you will
use to create a .
swf
file for use with Zoe.
Animated Sprite Sheets Using Zoe
Zoe, a tool created by the makers of CreateJS, is used to convert timeline animations created in Flash to sprite sheets
for use in EaselJS. The application is free and can be downloaded at
www.createjs.com/#!/Zoe
(see Figure
6-9
).
Figure 6-9.
Zoe web page found at
CreateJS.com