Is there a way to add a time delay to an action?

pinkprincess

  • Posts: 7
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
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
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

pinkprincess

  • Posts: 7
Thanks :)
It's working now.