TOUR
PRICING
HELP
Stencylpedia
Blocks Guide
Sample Games
Developer Center
Books & Courses
FORUMS
#MADEINSTENCYL
EDUCATION
SIGN IN
×
Welcome back!
Username or E-mail
Password
(
Forgot?
)
C
OMMUNITY
Home
Issue Tracker
Chat
Inbox [0]
New Posts
New Replies
Search
Stencyl Community
→
Stencyl
→
Ask a Question
→
Resolved Questions
→
[SOLVED] Start actor's animation from random frame?
Pages:
1
[SOLVED] Start actor's animation from random frame?
Almakos
Posts: 632
June 03, 2012, 01:42:02 pm
In other words, is it possible to randomize animations each time they are triggered?
« Last Edit: June 03, 2012, 10:34:03 pm by Almakos »
Fishing Fantasy Trailer
Ryusui
Posts: 827
June 03, 2012, 01:52:00 pm
Of course. Set the actor's animation and then set the frame.
NOTE:
I haven't tried this. ^_^; But it seems like it ought to logically work, right?
In the event of a firestorm, the salad bar will remain open.
Almakos
Posts: 632
June 03, 2012, 02:06:09 pm
em....I have animation and there 30 sprites in it. so, how exactly can I set frame from which it should play?
I can duplicate existing animation and rearrange frames so I would have prepared random animations, but this is very troublesome and I can make unwanted mistakes.. So I would better find a way how to start from random frame each time.
Fishing Fantasy Trailer
hansbe
Posts: 262
June 03, 2012, 02:26:12 pm
There are just a few blocks you need: "get frame count for [actor]" and "switch to frame [number] for [actor]", then use the get random number block to get a random number for the frame between 0 and the frame count ....
Almakos
Posts: 632
June 03, 2012, 10:33:33 pm
Thank you guys. I was struggling for a while with this riddle.
Here is a code what I've got, just in case any one else would need same thing
Fishing Fantasy Trailer
h1rnz1lla
Posts: 649
June 04, 2012, 12:49:43 am
cool, is this flash or iOS? because i tried something similar in iOS and it seems to crash every time.
Katrins colorful Moon Story iOS
,
Matchagon iOS
,
Super Zombie Tennis iOS
,
Muffin Munch iOS
- Available at the AppStore, Follow Us on Twitter
@Tinytouchtales
captaincomic
Posts: 6108
June 04, 2012, 02:11:04 am
It looks like it should work on both Flash and iOS. At least I can't see anything that wouldn't work on iOS.
Pages:
1