Reset Game, but not the Layout

0 favourites
  • 3 posts
From the Asset Store
2D fighting template based in the game that defined the fighting games genre.
  • 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.

  • 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 !

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Thanks a lot, Guizmus! <img src="smileys/smiley1.gif" border="0" align="middle" />

    I knew I was doing something wrong with the loopindex, now I won't forget.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)