Non-freezing Loop + allows delay



  • Is there any consideration of making a Loop behaviour that does not freeze until done, and allows you to have delays?

    This causes me to still often use timers instead of loops, which means extra behaviours and counting logic.


  • Admin

    You don't need to use Timers or loops. You can use Behaviour On / Off for this effect.

    0_1536780780982_Simulator Screen Shot - iPad 2 - 2018-09-12 at 15.32.49.png



  • @hamed that's an interesting idea, except I just tried it and it causes hyperPad to freeze then crash lol.
    EDIT: Interesting, crashes when I make it do instantaneous things (like Move By, Add To Score), but does not crash with Text Bubble. I guess because Text Bubble does not let itself get activated again before the previous has finished.
    EDIT2: Just remembered you can set Text Bubble duration to 0. When you do, and then run Hamed's setup, hyperPad will freeze and crash.



  • @kamdroid Your best option for running a super fast timer without freezing hyperPad might be to run a Loop under a Timer (you will still need your own counting logic) like this:
    0_1536795196422_DC1CED6F-3A19-4207-9618-E1A58F98F8BF.png
    So the higher you set the 'Number of times', the faster the timer will activate but also the laggier your game will become, so I would keep trying different values until it is as fast as I want it to be without causing much lag or FPS drop.
    Repeats per second = 'Number of times' × 60 (in this case with a 0s timer).



  • @hamed Ah yes, but it would be nice to have the counting/loop logic in the behaviour itself rather than adding if statements, add, etc. as the Loop behaviour does.


  • Admin

    Stack over flows are not something we will fix. In the case you want to prevent a crash like @Aidan-Oxley is describing, you need to use some kind of delay like a wait behaviour. or use a timer.



  • @hamed Hi, sorry for not being clear.

    I just think it would be nice to have a seperate version (or toggle) of the Loop behaviour so it allows for delay/wait behaviours.

    So I don't have to recreate how Loop behaviour works whenever I want to have a delay in my Loop.

    It's pretty much like me having to recreate the functionality of a for loop every time I need to use a delay. I just feel it is unnecessary.

    Alternatively, it would be cool to create custom behaviours (and add your own menu items when viewing the behaviour) so I can just make it myself if this is an issue.