[R99]Weird while bug

Bugs will be moved here once resolved.

Post » Wed Jul 25, 2012 4:34 am

When comparing which of two global variables is greater inside a While event, the game doesnt run in Chrome.
https://dl.dropbox.com/u/6813637/bug_while.capx

(Maybe its not a bug, but a logic mistake, Im not that good at programming.)
B
38
S
8
G
3
Posts: 438
Reputation: 6,869

Post » Wed Jul 25, 2012 6:25 am

The problem is that you're creating an endless loop. The game never gets past the While-statement, so it'll hang there forever.

It's important that you always have some actions to get out of the loop, and that you understand when you should use a while loop and when you shouldn't. If you for instance remove the While condition in your example the game will work, and the text will still be set to 'Yaaay' every tick.
B
20
S
5
G
4
Posts: 51
Reputation: 4,139

Post » Wed Jul 25, 2012 6:12 pm

Thanks @basti, I think Ive got the idea. ;]
B
38
S
8
G
3
Posts: 438
Reputation: 6,869

Post » Mon Jul 30, 2012 3:44 pm

Closing as not a bug.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,630


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 0 guests