Memory
Author |
Message |
Tallguy
|
Posted: Wed Jun 11, 2008 8:07 am Post subject: Memory |
|
|
Has anyone made a memory card game before?? i'm wanting to create my own virsion, and whish to see wat other ppl have created. I WILL NOT rip ur code, i just want to now where to start. |
|
|
|
|
|
Sponsor Sponsor
|
|
|
Dan
|
Posted: Wed Jun 11, 2008 5:58 pm Post subject: RE:Memory |
|
|
I could not find any in a quick search of the site.
Tho i think you could use a array that have one element for each card being shown on the screen and the value would repersent the value or type of card it is.
Then you need to fill the array ellments with the value of the cards (there should be 2 of each kind). To make it random you could either fill the array in order and then suffle it or fill it in a random order keeping track of what elements have been filled in.
Then you just need to draw the cards face down, and draw the face up value that corsponds to the arrays value when one is clicked. If the user makes a match set the value in the array to somthing like a negtive number or a value that is cealery not a card value. Make sure it will not draw cards face down or up right for thess values of the array. If the user does not make a match you simply redraw all the cards face down and do the change the arrays values.
Of course this is just one of many ways you could make this game but it hopfully will be an idea to get you going. |
Computer Science Canada
Help with programming in C, C++, Java, PHP, Ruby, Turing, VB and more! |
|
|
|
|
riveryu
|
Posted: Wed Jun 11, 2008 11:01 pm Post subject: Re: Memory |
|
|
Also, you can use the [source code] Tony has posted sometime ago for randomizing arrays without repeating values. Just search it. |
|
|
|
|
|
|
|