Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

[Coding Query] Pause or Stop Cycle

A topic by Errol created Nov 22, 2020 Views: 96 Replies: 2
Viewing posts 1 to 2
Submitted

Hello! Is there a way to pause or stop a cycle in case an interruption occurs?

I could have a boolean to check before running it, but I was wondering if there was another way to stop and restart it. 

Thanks! 

Host

Hi Errol,

I'm not 100% sure of the issue, but let me take a guess ...  I may be very wrong ...

Are you talking about restarting a cycle?

You can reset a cycle by associating a boolean with the cycle, and if the cycle starts running with this boolean having a true value, then the cycle resets to the beginning of the loop, and the boolean is set to a false value.

If this isn't the issue / problem, then let me know.


Once inside the scope of a cycle, one command must always run. If you don't want a cycle to run for some other reason, then wrap it in an if statement.

Submitted

Oh! It's not a problem, I was just wondering if there was a way I stop or pause a cycle for a few ticks, and then continue it (and not use skip interval, because it would be manual). 
(Although, I wonder if I can make skip_interval a variable, hmmm.)
Anyway, thanks! I now understand how that reset_variable works. So that's good too! ^_^