TOUR
PRICING
HELP
Stencylpedia
Blocks Guide
Sample Games
Developer Center
FORUMS
CHAT
#MADEINSTENCYL
EDUCATION
SIGN IN
×
Welcome back!
Username or E-mail
Password
(
Forgot?
)
C
OMMUNITY
Home
Issue Tracker
Inbox [0]
New Posts
New Replies
Search
Stencyl Community
→
Stencyl
→
Ask a Question
→
Resolved Questions
→
Is there a way to add a time delay to an action?
Pages:
1
Is there a way to add a time delay to an action?
pinkprincess
Posts: 7
June 14, 2011, 09:33:52 am
What I'm trying to do is fire a cannon three times with a .5 second interval and then pause for 1 second and fire again. I now realize that the do after time block refers to an absolute time not a time count. I have attached a screen shot of what I have
Alexin
Posts: 3127
June 14, 2011, 09:48:21 am
First, the while loop will hang the game as long as the actor is alive. You must take it out.
The "do after executes" has a delay of 0.5 seconds and, since you repeat three times, it will take 1.5 seconds to "execute". This is a problem given you intention and the fact it's placed inside a "do every 1 seconds".
See the attachment, I think it will do what you want (not tested).
"Find the fun"
alexin@stencyl.com
Rhys
Posts: 1046
June 14, 2011, 09:51:21 am
Do every 2 seconds {
tell self to (cannon) for all behaviours
Do after 0.5 seconds {
tell self to (cannon) for all behaviours
}
Do after 1 seconds {
tell self to (cannon) for all behaviours
}
}
Something like that should work.
EDIT: fphhphsspppfelff ninja'd by Alexin
http://amebo-emu.tk
pinkprincess
Posts: 7
June 14, 2011, 08:23:27 pm
Thanks
It's working now.
Pages:
1