Hi, I was asked to do a memory match game and I took as an example “Pairs” that is in the tutorials, but I need to use the keyboard arrows to move and select the cards, not the mouse as it is pre-designed.
Any ideas or suggestions of what conditions or actions I should use?
Should I use a hidden hitbox?
Would it work if I put a joystick on the screen that is controlled with the keyboard?
I would appreciate any ideas, I am very new to this.
Greetings.
what i would do here is use a hidden card (aka make a duplicate of the card and use the hide function, by making a group called “hitboxes” or something too that effect)
and make those move instead of the actual cards
so basically if you want semi code:
if mouse/cursor is on: “card ace 1”| move “hitbox card ace 1, -60 x units”
left key is pressed |
if this isnt what you meant im sorry i cant really tell what you mean. if you want too be a bit more specific i can probably give you a better answer
I think you can make an object with four points up/down/left/right and use those points to navigate.
If up key is pressed and the point Up is inside a Card object, move ActivateCard object to Card (position of Up point) then move the four points to position of ActivateCard.
Thanks for the answer, it was very illustrative to be able to do something.
I followed the steps, but two things happen that I don’t quite understand how to solve:
The “hand” object shows behind the cards. I modified the Z axis value but it remains the same.
When I select a card, it immediately shows me the pair and matches between the two.
What part of the code should you modify to follow the original logic of the game?
You’re right, now it works just like you showed it.
Just one last thing, doesn’t it happen to you that when you press a key several times in a short time, the cursor moves out of position?