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
→
How to modify the Fire Bullet V2 to add Delay?
Pages:
1
How to modify the Fire Bullet V2 to add Delay?
zidaxxx
Posts: 131
March 14, 2015, 08:38:09 am
Hello everybody, I'm here again asking your help on this behavior.
How can i add delay in Fire Bullet to Enemy when i Press the action1 key?
because when I press the action button couple of times or spam it. it just shoot so many times in every seconds.
so how can i make 1.5 seconds delay on this behavior? can someone help me please?
PhilIrby
Posts: 545
March 14, 2015, 10:10:19 am
Create a Boolean attribute "canShoot" and set default value to true. Put all the blocks except "when action2 is pressed" inside this......
if (canShoot)
set canShoot to false
[ do after (1.5) sec]
set canShoot to true
All the rest of your behavior here
|
|
and put all the above inside "when action2 is pressed"
zidaxxx
Posts: 131
March 14, 2015, 07:06:03 pm
I did what you said but it doens't work to me sir...
PhilIrby
Posts: 545
March 14, 2015, 07:13:13 pm
All of your code has to be inside of the If(canShoot) block
zidaxxx
Posts: 131
March 14, 2015, 07:29:10 pm
thank you sir, it works now. sorry because i am bad at understanding in english hehehe...
thank you again sir.
PhilIrby
Posts: 545
March 14, 2015, 07:39:52 pm
I think your sound for spear throw needs to be above the "do after" block. Otherwise your playing it 1.5 seconds after it was thrown( if you set default value of canShoot to true as I suggested )
Pages:
1