Show face cards for 5 seconds on memory match game

Get help using Construct 2

Post » Sun Jul 01, 2012 11:04 pm


I would like to show the face cards for 5 seconds for the player to memorize them. How could I do this?

See the image below what I'm trying.. but it's not work properly..

Construct2 code

asmag

Regards

asmag2012-07-01 23:18:29
B
9
S
3
G
3
Posts: 16
Reputation: 2,786

Post » Mon Jul 02, 2012 7:00 am

Hi

I would use the "Function" plugin. I found it useful for running code asynchronously.

In the function you could pass a parameter of the card name.

Then in the function you could do something like:
Set card frame to (face up frame)
System -> wait
Set card frame to (face down frame)
B
22
S
7
G
3
Posts: 189
Reputation: 4,270

Post » Mon Jul 02, 2012 1:49 pm

Hello!

You could make the file available. Capx with this change please?

Att. asmag
B
9
S
3
G
3
Posts: 16
Reputation: 2,786

Post » Mon Jul 02, 2012 2:09 pm

No need for plugins here, just use instance variables:

CardTimer.capx (r97)
B
27
S
8
G
8
Posts: 903
Reputation: 8,452

Post » Tue Jul 03, 2012 1:59 am

Thanks man!

It's ok now. On LAYOUT THE CARDS SESSION, after created the card, I put the next 3 lines :
Set animation to "CardFace" ( play from beginning )
Set animation frame to Card.Cardfaceframe
Set FaceUp to True

Next, I created the blank subevent and put the action :
System Wait 5 seconds

And, I created one more subevent : System Pick all Card and put the
action ( next 2 lines ):

Set FaceUp to False
Set Animation to "CardBack" ( play from beginning )

Bingo! My game works fine.

Att. asmag
B
9
S
3
G
3
Posts: 16
Reputation: 2,786


Return to How do I....?

Who is online

Users browsing this forum: Lof, Yahoo [Bot] and 4 guests