Is there something wrong?

Get help using Construct 2

Post » Fri Apr 03, 2015 7:47 pm

Image

I try execute but don't work it crashes, When I remove the while it works

I want the objects appear at different times.
B
5
Posts: 31
Reputation: 295

Post » Fri Apr 03, 2015 7:53 pm

Your While loop will never end as there is nothing in it to change "aux". At a guess, get rid of While altogether.
ImageImageImage
B
71
S
19
G
180
Posts: 3,484
Reputation: 103,189

Post » Fri Apr 03, 2015 7:57 pm

In your while statement, you are saying while aux < 5 but you are not incrementing the aux. That means aux will always be less than 5 and the loop will repeat for ever (or at least until you run out of memory and the game crashes). This is called an Infinite Loop.
B
38
S
12
G
11
Posts: 331
Reputation: 7,712


Post » Fri Apr 03, 2015 8:09 pm

Oh thx, guys
B
5
Posts: 31
Reputation: 295

Post » Fri Apr 03, 2015 8:12 pm

Image
Change, is it better?
B
5
Posts: 31
Reputation: 295

Post » Fri Apr 03, 2015 9:08 pm

This change will stop the endless loop but it doesn't do the same thing. From this image, it looks like you are just trying to make your objects flash after touching the text object. If this is correct, I would suggest you make use of the flash behavior instead of using your events the way you have them set up.
B
38
S
12
G
11
Posts: 331
Reputation: 7,712

Post » Sat Apr 04, 2015 12:44 am

I'm trying to do something like a Whack A Mole.

What better way to do this?
B
5
Posts: 31
Reputation: 295

Post » Sat Apr 04, 2015 1:02 am

I think that looks like it could work as a whack mole, but I would set the every 2.0 seconds for example to every random(1)+1 this would make it between 1 and 2 seconds or you could random(2)+1 which would be between 1 and 3 seconds. same as random(1,3)

:) just figured you might like it more random.
B
6
S
1
G
1
Posts: 31
Reputation: 945

Post » Mon Apr 06, 2015 10:04 pm

heromedel wrote:I think that looks like it could work as a whack mole, but I would set the every 2.0 seconds for example to every random(1)+1 this would make it between 1 and 2 seconds or you could random(2)+1 which would be between 1 and 3 seconds. same as random(1,3)

:) just figured you might like it more random.


Ohhh My God,
as not thought of that?
Thanks guy
i love you :))))
B
5
Posts: 31
Reputation: 295

Next

Return to How do I....?

Who is online

Users browsing this forum: LukeW, Yahoo [Bot] and 12 guests