Infinite loop. Something was wrong??

Get help using Construct 2

Post » Sat Sep 03, 2016 2:57 pm

Hi, guys
I use for loop (from 1 to 2) to append a text same as:
Image

but I received Infinite loop.

This is result :
Image

I think the result must return
_1_2

Something was wrong?

sr, my english is not good :D
Last edited by gameba on Sat Sep 03, 2016 3:06 pm, edited 1 time in total.
B
38
S
19
G
19
Posts: 69
Reputation: 12,634

Post » Sat Sep 03, 2016 3:06 pm

there is no conditions before your loop, therefore it will repeat each tick (aka each time the screen is drawn).
On start of layout is an exemple of system condition that will make it so it returns _1_2 when the layout starts.
Game design is all about decomposing the core of your game so it becomes simple instructions.
B
53
S
22
G
18
Posts: 2,122
Reputation: 17,123

Post » Sat Sep 03, 2016 3:38 pm

Aphrodite wrote:there is no conditions before your loop, therefore it will repeat each tick (aka each time the screen is drawn).
On start of layout is an exemple of system condition that will make it so it returns _1_2 when the layout starts.

I thought 'for-loop' is run without any conditions, its will run once only but I was wrong. Thank you!
Last edited by gameba on Sat Sep 03, 2016 3:40 pm, edited 1 time in total.
B
38
S
19
G
19
Posts: 69
Reputation: 12,634

Post » Sat Sep 03, 2016 3:39 pm

The loop runs once, but the C2 engine runs all events 60 times a second, so you have to design your code with that in mind.
ImageImageImage
B
71
S
22
G
249
Posts: 3,763
Reputation: 138,577

Post » Sat Sep 03, 2016 3:43 pm

blackhornet wrote:The loop runs once, but the C2 engine runs all events 60 times a second, so you have to design your code with that in mind.

wow, This is a information really useful for me. Thank you !
B
38
S
19
G
19
Posts: 69
Reputation: 12,634

Post » Sat Sep 03, 2016 4:48 pm

B
11
S
6
G
15
Posts: 256
Reputation: 9,207


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 18 guests