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 pause a main time?
Pages:
1
How to pause a main time?
makarone
Posts: 15
April 26, 2012, 11:44:29 am
HI i have an issue.
In my project i'm using an event that spawns actor types "after time" ( do after time- 30 sec).
When i'm pausing the game for ~20 seconds at the begining of the scene.
Actor type appears after 10 seconds after game was unpaused.
But he must appear after the 30 seconds.
It seems like Pause function didn't works for that and time still counts.
Can you help me?
Thanks.
rob1221
Posts: 9473
April 26, 2012, 12:01:54 pm
There's probably some code you can use to pause a timer, but I don't know what it is. A workaround is using a counter that spawns an actor when it reaches a certain number. For example, you can increase the counter every 1 second and when it reaches 30, reset it to 0 and spawn the actor. You'll also have to check if the game is not paused before increasing the counter.
https://twitter.com/Rob1221dev
makarone
Posts: 15
April 26, 2012, 12:17:00 pm
Thanks for the Quick response Rob.
Sorry, i have made a little mistake.
I said that i'm using a "do after time" but there is a " Do every [30] seconds" block.
I tried with these code blocks:
do every [time]+30
Time- it's a game atribute , number.
it counts +1 every second.
But it still wont stops.
rob1221
Posts: 9473
April 26, 2012, 01:38:57 pm
Timers in scene behaviors don't pause. You have to check if the game is not paused (there's a block for that) first.
https://twitter.com/Rob1221dev
makarone
Posts: 15
May 05, 2012, 01:56:32 am
Thanks! Problem solved!
Pages:
1