Need help with memory game

For questions about using Classic.

Post » Wed Sep 01, 2010 1:46 pm

Could someone please tell me how i could make a memory type game with Construct?.It's like that picture game where you have to match the two pictures in order to score points.And if the two pictures match the pictures that matched will dissapear.Ive tried the animation frame set in the event editor but it will only work with two pictures.Some help would be greatly appreciated.It must be like the example pic below.This was done with the oldskool knp.



Thanks in Advance
DravenX
[quote:3veoqbgw]Knowledge is Power[/quote:3veoqbgw]
B
22
S
3
G
6
Posts: 1,356
Reputation: 7,141

Post » Wed Sep 01, 2010 4:00 pm

Is this game to complicated for Construct?.I see that no one knows how to do this.Please help if you can.
B
22
S
3
G
6
Posts: 1,356
Reputation: 7,141

Post » Wed Sep 01, 2010 4:18 pm

I would be a little more patient for someone to reply, this isn't exactly the fastest forum in the world.
B
3
G
2
Posts: 26
Reputation: 727

Post » Wed Sep 01, 2010 4:29 pm

Lol yes i can see that.My kids are nagging me to create this memory game ,Thats why im so impatient.I am getting the hang of this though.The events are almost the same as my 1994 oldskool KNP game creator.I just don't know why the event's are so complicated with Construct,Or im just too oldskool for these new events lol.

I have created some nice games with Construct for my kids.I did the old contra and a maths game with Construct.But this memory game is starting to frustrate me now.And KNP can only do 8 bit colors which are useless in today's standards.And i do not want to use XNA game studio because im creating my 3d games with that prog.
B
22
S
3
G
6
Posts: 1,356
Reputation: 7,141

Post » Wed Sep 01, 2010 4:33 pm

I had KNP once.... well, I had the manual. The actual CD was missing. That's second hand for ya. The manual was a good read though.
B
3
G
2
Posts: 26
Reputation: 727

Post » Wed Sep 01, 2010 5:45 pm

I already created a memory game and it isn't particularly complicated to achieve this. You could just have all your card images as frames of a single sprite. Then compare those frames. That's like the basic principle.

I'd share my cap but it's using family photos as card images. I would have to edit those out before I put it on the internet. Which I can't do right now. But it's easy enough to figure this out by yourself (hopefully). :)
B
21
S
6
G
10
Posts: 1,024
Reputation: 7,445

Post » Wed Sep 01, 2010 6:04 pm

Yes that's what im doing but the events will only recognise one thing.For instance ,when i click on one card and then on the next card which matches then those two cards will be destroyed ,But if i put in a different card and try to compare those frames then nothing happens

[quote:hqe32xhd]I'd share my cap but it's using family photos as card images. I would have to edit those out before I put it on the internet. Which I can't do right now. But it's easy enough to figure this out by yourself (hopefully). [/quote:hqe32xhd]

Could you make an example of such a game for me please.just with 4 blank sprites with different color blocks for each animation frame.I want to see how you use the events in creating such a game.
B
22
S
3
G
6
Posts: 1,356
Reputation: 7,141

Post » Wed Sep 01, 2010 6:13 pm

Pixel's way sounds pretty good. All you would need is a private, and a global variable.
Something like:
>global.picked is less than 2
>-on object card clicked add one to global.picked
>--object card set frame to turned

>global.picked is less than 2
>object card frame = turned
>object variable = club
>- object card destroy
>- set global.picked to 0
Course you might want a loop if your doing all 52 cards.
Also the function "call function after delay" would work nice here.
The key is picking.

Edit yeah dont use frames to compare use a pv.
Image Image
B
161
S
48
G
90
Posts: 7,348
Reputation: 66,751

Post » Wed Sep 01, 2010 6:19 pm

Thanks for your help newt.But im so in the dark with all this new coding stuff.And im starting to confuse the codes with XNA lol.Please if someone could create a tutorial cap for a game like this then it would be wonderfull for oldskool newbs like me.
B
22
S
3
G
6
Posts: 1,356
Reputation: 7,141

Post » Wed Sep 01, 2010 9:12 pm

I just created a quick memory example from scratch. It's nothing to look at, just plain colored cards and it's also not commented. I'm using an Array object, HashTable object and the Function object. You probably should be familiar with those in order to understand this example (consult wiki).

[url:ipxd3ra9]http://dl.dropbox.com/u/2306601/memory_004x2.cap[/url:ipxd3ra9]

The X/Y Size of the array defines the number of cards. Not too different from the puzzle tutorial I create the cards from that array. I randomize it so that there will be 2 of every possible card by using the hashtable (adding and deleting keys from it in a certain manner). You'll see there are different loops and some math with Globals involved which might look confusing on first sight. But it's nothing too complicated really.

There may always be a better method to do this. At least this is a lot less of a hassle than the old version I did over a year ago. Anyway, I hope it's helpful to you. :wink:
B
21
S
6
G
10
Posts: 1,024
Reputation: 7,445

Next

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 0 guests