You can drag and drop an image into Stencyl while the Actor Editor is open. Doing this will bring up the dialog you see in method 1.
- Dragging in an animated GIF will bypass the dialog and immediately import the frames.
- Dragging in an image to the Dashboard or an editor that is not the Actor Editor will have varying effects, none which will import a new animation for the current Actor. Expected but worth noting.
For all of these blocks, the "animation" blank takes in an Animation attribute or value. You can convert plain text into an Animation value using the "as animation" block.
All of these blocks are found under Actor > Drawing.
Note: As stated right above, if you want to type in the name of the Animation directly, use the "as animation" block.
What's the current Animation?
Is the current Animation still playing?
Sometimes, it's useful to check if the current animation is still playing, particularly if the animation does not loop, and you want to detect if it has finished playing through.
Switch to Frame
This block lets you skip around or reset an animation to its starting frame.
Note: Frame indices are displayed in the gray boxes and start from 0. Switching to an invalid frame leads to nothing happening.
Current Frame Index
Total Frame Count
More Animations or More Actors?
There is no limit to the number of animations an actor may have. However, it's best to consider when it's appropriate to go with more animations or whether it's better to create a brand new actor.
The Zelda Dilemma
The Zelda Dilemma is a classic game design problem you run into when making an Adventure game and decide how you want to create your Hero character.
So suppose that we start with just the basic animations.
Not to bad so far. But Link holds a sword! So we have to add 2 more sets of animations, one for holding the sword and one for slashing it.
Walk + Sword
Walk + Slashing Sword
But wait, there's more! Link changes swords throughought the game. He can hold the plain sword, the Master Sword and the Golden Sword, and they all look different! That would triple the animation count.
And what about the Bow and Arrow, holding a shield and... you get the picture.
The Bottom Line
In cases like these, it's better to create a new actor rather than add more animations. This is particularly applicable when an actor equips items that slightly alter the appearance and could be accurately and convincingly drawn separately.
(From Zelda - the sword is a separate actor)
There are other benefits to having different actors.
Easier to define collision bounds, particularly for weapons.
Confine extra behaviors to the separate actor, rather than creating 1 monolithic actor with everything.
The bottom line is that there's no silver bullet and no simple rule. You simply have to create and recognize when things are going the wrong way. Hopefully this example shines light on a case where it's thoroughly clear that an all animations approach is flawed.
It's best if all animations are the same size.
It may be necessary in some cases to ensure that all animations of an actor are equal in size. Making animations different sizes, for the same actor, could have a negative impact, especially if the origin point is different in each animation.
Two common scenarios are:
The actor magically jumps to a slightly off-center location when you switch animations.
The actor's collisions mess up because the new animation has the collision bounds located in a different part of the animation.
Note: This gotcha has been a pain point for some. We're working on addressing this point for Stencyl 2.x.
Animations, Blocks & Attributes
Note that when using the "switch animation" block, you cannot type text directly into the blank. Instead, you have to wrap that text inside an "as animation" block like the following.
Reminder: All animation-related blocks are located under Actor > Draw.
Actors with No Animations
Actors with no animations at all may crash the game. We'll address this in a future version of Stencyl. Note that this is different from an Actor with a single blank (0 frame) animation, which will work just fine.
Animations are states, such as standing, walking and running.
Animations consist of frames (how it looks) and collision bounds.
Exercise good judgement in deciding whether to go with an actor with many animations versus several actors with fewer animations.
Challenge: Equipment for an Adventure Game
We talked about the "Zelda Dilemma" above. Now's your chance to see this for yourself and do things the right way.
Create a simple walkaround demo in which the character can equip different items that show up in that character. Do this the right way, by making those items each their own actors.
Last Updated: 2012-05-13 by Ceric
40343 have read this article
Disclaimer: The Stencyl Team does not actively monitor comments on articles. If you're seeking help for your game,
please ask a question on the forums. Thanks!