Reset Game, but not the Layout

Get help using Construct 2

Post » Thu Jul 04, 2013 6:33 pm

I'm trying to do a "couples" game. Try to flip two identical cards.

I don't want to have the cards placed on the layout, I want to create them at runtime.

I've got it done, and it works.

Now, once you're done I want to reset the cards (but not the layout). And whatever I try to do, I can't do it.

If anyone could help me, here's what I've been able to achieve.

Thanks in advance.
B
7
S
2
G
2
Posts: 25
Reputation: 1,910

Post » Thu Jul 04, 2013 7:54 pm

Hey @Angel

So I took a look at your capx. Here is my "iteration" on it : capx
What was the problem you are going to ask ?
Well, if you open the capx, let's take a look to the event 8. When the last couple is taken, you will start by waiting 0.5 sec, making this event "outside of the timeline", meaning other events will trigger while. When it triggers though, the "substract 1 from min_par_NoMatch" will make the event 12 trigger before the reset of mini_par_Card1 & 2 triggers (line 11). (please traduce your variables next time you need help ^^ i had hard time understanding the program at first, comments are nice too :p)
So well, the cards were being redraw and then destroyed by the event 7 retriggering...
I changed it by checking that mini_par_card1 was >0 in event 8.

On the side, I modified the function "placeCards", as it seems you didn't know the loopindex("name_of_the_index") function, that would have saved you a lot of trouble ^^ I let your event, commented, so you see what i did.

Hope this helps !
B
17
S
8
G
4
Posts: 461
Reputation: 6,157

Post » Thu Jul 04, 2013 8:31 pm

Thanks a lot, Guizmus!

I knew I was doing something wrong with the loopindex, now I won't forget.
B
7
S
2
G
2
Posts: 25
Reputation: 1,910


Return to How do I....?

Who is online

Users browsing this forum: facecrime, mihirolover and 7 guests