Card match system?

Hi there! I’m working on a little side project for funsies and I was wanting some help with creating a memory game. My thought was that the “memory cards” could each be assigned a random number on spawn that translates into a specific animation frame, but I am a little bit stumped on the matching system. Specifically, I’m worried about accidentally spawning in an uneven number of matching tiles. Is there a way to foolproof this? Can you impose rules on randomness?? Any help is very appreciated!

1 Like

i don’t think you should be trying to make a game if you need help with every single component of it

you should try making more simple stuff beforehand so you can improve.

1 Like

I spend a lot of time using an empty sandbox to test out ideas and see what might work best, but certain things do not come easily to me as I lack the experience neccesary to find the answer on my own. That being said, I have largely taught myself everything that I have learned up to this point save for some more complicated concepts that I have asked for clarification for on the forums since it is an excellent resource of experienced coders.

You are not obligated to help me, but I ask that you not give unwarranted advice when I am using the forum as intended to ask for assistance from people with more experience. I am learning in the way that suits me best, and telling me that learning the base concepts of code will serve me better in the future does not help me learn any faster.

In the future, it would be more beneficial to me if you assisted in answering my question or ignored the post altogether.

2 Likes

It doesn’t sound at all like he needs help with every aspect. It seems like he has a good understanding of the principes required for this, and being able to spot a potential problem before you’re even at that step is a great sign.

1 Like

Is the number of cards going to be adjustable?

So you have the correct idea with spawning them in. The worry of creating a non repeating random number though is valid.

This is a system I created for it. it probably has some extra features with the “reset” and “fail” options that you probably won’t need.

What it basically does is gets the range that is inputted into it (your range might always be defined as 1-X, so that might be another unneeded step for you).
It finds the difference between that range, then adds a Number List a value increasing from 1, starting at the base value. You’ll want to want add 2 of every number to ensure duplicates are fine (or you can just rerun the system with the same range of numbers)
The reason it’s added to a List is for the next step.
The List is “Shuffled” (via the List Order behavior). This random placed the values inside the List.
Now that the List is randomly ordered, you can get values from inside it with the “Pop” input.
That will output and remove the last value inside the List, and it’s random because the list was shuffled.

After that you just need to match the cards, which you might already have an idea of how to do.

Ah just realized you were helped on the discord. Well the way in which I described how the system works is probably similar to what Galactian did, we generally think of similar solutions for smaller systems like this

still very appreciated!! I enjoy the chance to test out different options as well, and this would likely work better for my purposes since I’m planning on adding a couple different difficulty levels with different #s of cards!! Thank you for the reply!! :slight_smile:

2 Likes

You should play around and get comfortable with lists

I agree! Definitely my weakest skill :sweat: I’m slowly learning to rely on them more but there are a lot of things that still haven’t fully clicked!

1 Like