How do I

Just started using Construct 2? Post your questions here

Post » Mon Mar 03, 2014 3:24 pm

Hello

In C2 is it possible to do this -

have several sprites that light up sequentially with like a second inbetween. The user has to try and hit space on the last sprite. If they fail a message is displayed along the line of 'Bad luck, try again' if successful a message like 'well done' is displayed.

I am using the free version of C2 but if this can be done then I'll be purchasing a full license.

Thanks everyone

Bazzman90x
B
5
S
1
Posts: 21
Reputation: 417

Post » Mon Mar 03, 2014 3:26 pm

Yes, you can easily did this with the free version of C2.
B
39
S
15
G
5
Posts: 295
Reputation: 6,089

Post » Mon Mar 03, 2014 3:39 pm

hey Joskin, thanks for replying, are you able to show how it can be done?

I tried to do a For loop to switch on each sprites, 'lit' animation, with a separate event to detect 'space' bar press which stops the loop but the loop just continues. I thought one way would be to assign a variable to each 'lit' animation frame and then do a compare.

thanks for helping out.
B
5
S
1
Posts: 21
Reputation: 417

Post » Mon Mar 03, 2014 3:43 pm

Your loop should have another condition, for example a global variable called "spacePress" with a value of 0.
On space pressed set the value of "spacePress" to 1.

And in you loop add the condition : spacePress = 0. Then when space will be pressed, spacePress will take the value 1 and the loop will stop.
B
39
S
15
G
5
Posts: 295
Reputation: 6,089

Post » Mon Mar 03, 2014 3:45 pm

Global? I was thinking a local variable for each sprite would be needed.

With your suggestion when space is hit, will the sprite that is lit remain lit?
B
5
S
1
Posts: 21
Reputation: 417

Post » Mon Mar 03, 2014 3:48 pm

You should post a commented capx of your work, explaining what you, where you're blocked etc.
B
39
S
15
G
5
Posts: 295
Reputation: 6,089

Post » Mon Mar 03, 2014 3:51 pm

I can post a capx on here? or do I need to host it some where?

Again thanks for your help.
B
5
S
1
Posts: 21
Reputation: 417

Post » Mon Mar 03, 2014 3:51 pm

You asked the same question a few days ago and a lot of people helped you:
viewtopic.php?f=147&t=97549&p=746819#p746819
B
14
S
3
G
1
Posts: 255
Reputation: 2,027

Post » Mon Mar 03, 2014 3:52 pm

Dunno if you can attach a capx on your post (due to your low rep), but you can host it on a dropbox folder.
B
39
S
15
G
5
Posts: 295
Reputation: 6,089

Post » Mon Mar 03, 2014 3:57 pm

Nice one Joskin !
B
5
S
1
Posts: 21
Reputation: 417


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 0 guests