Object blinking...

Discussion and feedback on Construct 2

Post » Mon Dec 26, 2011 7:21 pm

I know there's a behaviour to make this work but why its not working? Se the pic below:

Its should blink...
Thanks in advance!
Be nice with others and with yourself!
My musics: https://soundcloud.com/vinians
My C2 Forum:
http://nmbr.forumeiros.com/
My Site:
http://www.dicasebytes.com.br
B
21
S
5
G
6
Posts: 166
Reputation: 4,885

Post » Mon Dec 26, 2011 8:04 pm

"Stop Loop" just keeps another loop from being done, it doesn't stop at the current event.

Try using "wait", it's much simpler.

Every 1.0 seconds
-objPushClick | Set Invisible
-Wait 0.5 seconds
-objPushClick | Set Visible
B
79
S
24
G
54
Posts: 4,749
Reputation: 40,761

Post » Mon Dec 26, 2011 9:11 pm

I did not know. I thought the "Stop loop" to end the loop at the time, even think it would be more correct, how it works in programming languages??.
The wait command immediately ends the event?
I think the loop should end because it makes it totally different than expected, and makes people experienced in other languages ??do dumb questions like I did ..
Thanks for the help.
Be nice with others and with yourself!
My musics: https://soundcloud.com/vinians
My C2 Forum:
http://nmbr.forumeiros.com/
My Site:
http://www.dicasebytes.com.br
B
21
S
5
G
6
Posts: 166
Reputation: 4,885

Post » Tue Dec 27, 2011 3:30 am

'Repeat 1 times' does nothing, events run once normally anyway!

Follow the logic of the events:

Is sprite invisible?
- yes, set it visible
- stop loop does nothing since the current iteration will finish anyway

Is sprite visible?
- yes, we just set it visible in the last event
- set it invisible again

End result: nothing happens, the object is set visible then invisible immediately after.

Why not use the Flash behavior anyway?!Ashley2011-12-27 03:31:09
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600

Post » Tue Dec 27, 2011 1:04 pm

I think you did not understand my reasoning. The use of the loop was only to address the lack of an "else". See this example on a hypothetical programming language:
[code]
repeat (1)
{
    if (visible) then
        visible = false
       break; / / here I get out of the loop to not run the second test
                   / / is like a goto the end of the loop
                  / / else it because we have not
   endif
   if (not visible) then
       visible = true
   endif
}
[/code]
See what I was saying?
Btw, the problem was solved.
Vinians2011-12-27 13:04:19
Be nice with others and with yourself!
My musics: https://soundcloud.com/vinians
My C2 Forum:
http://nmbr.forumeiros.com/
My Site:
http://www.dicasebytes.com.br
B
21
S
5
G
6
Posts: 166
Reputation: 4,885

Post » Tue Dec 27, 2011 4:23 pm

Yeah, I guess the issue is 'stop loop' is different to 'break'. 'stop loop' finishes the current iteration.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 9 guests