HELP! Infinite loop error!

Hello,
I am 10 years old and a flowlab beginner.
I have a problem with my game.
I keep having a thing called Infinite loop error, and I was hoping someone could help me with my code or it would be even better if someone could show me how to fix it myself.
Here is a link to my game:

            https://flowlab.io/game/view/1781815

Thanks in advance, Game On!

amazegames

4 Likes

I believe this is your problem, on L3.

a

Impulse is meant to be attached to a number for jumping. You’ve attached it to an always block with no value.

1 Like

@TGW is correct that this is a bit weird, but that shouldn’t cause any infinite loops.

I played your game and didn’t get any errors, how do you trigger the problem?

An infinite loop is what it sounds like: some logic that that re-runs itself forever. The simplest way to create an infinite loop is to connect your logic in such a way that a block’s output can activate its input. This creates a bit of logic that has no way to finish, and will cause the error you are seeing.

3 Likes

I got the infinite loop when I got to L3 in the game.

I didn’t see anything else that might be causing it, unless there is a hidden behavior I missed.

EDIT: Also just found this on L3…

I’ve never tried looping an alert back to itself, but I’m guessing that’s not advisable?

BINGO. Yep, that’s the culprit. Just tested it in my own game and infinite looped myself.

SOLUTION: Remove the connection going from the Alert box “click” back to the Alert box “hide” input.

Also, side note, not sure if you’re aware, but L3 does not currently have a path to L4. It’s set to restart current level no matter what you do.

4 Likes

Thank you so much TGW.

sincerely,
amazegames

3 Likes

Hide is the same thing as a click, so its infinitely closing the Alert box.

1 Like

I need help too. My game also has an infinite loop error on the “Arena” level. Link: https://flowlab.io/game/play/2143075 Please help me.

1 Like

It looks like your BANANANA object emits a BANANNANA object any time it spawns or is emitted. This is an infinite loop.

Also, welcome to the forums - next time just make a new topic for your game/issue instead of reopening an old one :+1:

1 Like