Need help with memory game

For questions about using Classic.

Post » Thu Feb 24, 2011 4:10 pm

Hi there,
I would like to ask another question about how this works.

In "Start of Layout" Event No. 4 it says

Event: For "Addkeys" from 1 to (Array.SizeX*Array.SizeY) 2
action : HashTable: Insert key str(LoopIndex+1) with value 0

What does that exactly do?

I am trying to modify it, so the pairs, which are already correct dissolve instead of just staying there, but to no success yet.

So I am trying to find out, what each line in the Event sheet is doing exactly.

Thanks a lot in advance!

Manuela
B
1
G
1
Posts: 2
Reputation: 429

Post » Thu Feb 24, 2011 4:21 pm

[quote="Manuela77":339xvp70]Hi there,
I would like to ask another question about how this works.

In "Start of Layout" Event No. 4 it says

Event: For "Addkeys" from 1 to (Array.SizeX*Array.SizeY) 2
action : HashTable: Insert key str(LoopIndex+1) with value 0

What does that exactly do?

I am trying to modify it, so the pairs, which are already correct dissolve instead of just staying there, but to no success yet.

So I am trying to find out, what each line in the Event sheet is doing exactly.

Thanks a lot in advance!

Manuela[/quote:339xvp70]

This event is a loop inserting keys into a hashtable for every unique card image. That's why it's calculated from the multiplied Array X and y Size and then divided by 2, since we are dealing with pairs.

The hashtable is then used to check if there are already two cards of the same picture present for startup randomization.
B
21
S
6
G
10
Posts: 1,024
Reputation: 7,445

Post » Mon Mar 21, 2011 8:10 am

Hm,

thanks for all the help on such a game done in Construct.

Can anyone tell me how to make the cards, which have been picked correctly invisible? I tried moving to back, destroy or play an empty animation file. All I achieved was, that only only the last picked card went invisible :/

That would be awesome!

Thanks,

Keyleigh
B
1
G
1
Posts: 2
Reputation: 429

Post » Mon Mar 21, 2011 4:42 pm

Here is my attempt.The cards are getting destroyed now if the right colors are picked.I did not use arrays etc for this.
[url:3q305huv]http://dl.dropbox.com/u/7658043/CardsMem2.cap[/url:3q305huv]
B
22
S
3
G
6
Posts: 1,356
Reputation: 7,141

Post » Mon Mar 21, 2011 6:59 pm

And here is the new and improved memory card game.Almost like that old klik and play memory game, I added pictures now and the cards gets destroyed.Added a scoring system too.
[url:t3x0iskv]http://dl.dropbox.com/u/7658043/CardMem2.1.cap[/url:t3x0iskv]
B
22
S
3
G
6
Posts: 1,356
Reputation: 7,141

Post » Tue Mar 22, 2011 5:22 pm

[quote="Keyleigh":2gnuqit7]Hm,

thanks for all the help on such a game done in Construct.

Can anyone tell me how to make the cards, which have been picked correctly invisible? I tried moving to back, destroy or play an empty animation file. All I achieved was, that only only the last picked card went invisible :/

That would be awesome!

Thanks,

Keyleigh[/quote:2gnuqit7]

Didn't test DravenX's example, so you might as well try that. For the older example I did, you can pick correctly matched cards with an inverted overlap condition of the Card sprite with the family blue.
B
21
S
6
G
10
Posts: 1,024
Reputation: 7,445

Post » Tue Mar 22, 2011 5:55 pm

[quote:q3gnorzy]For the older example I did, you can pick correctly matched cards with an inverted overlap condition of the Card sprite with the family blue.[/quote:q3gnorzy]
@PixelRebirth Could you please create a cap file.I want to see how you did it. :wink:
B
22
S
3
G
6
Posts: 1,356
Reputation: 7,141

Previous

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 3 guests