Hi, I’m trying to make a card game similar to 21 (Blackjack) and using the Card system example I tried to make that if the player clicks on a deck, a card in the reserve deck goes in a deck, something like this
but however, when I coded the mentioned in the image above, and when previewing the game, I clicked in the first deck and it looks like this
but this is not what I wanted, I wanted to just put one card in the clicked deck, and on the deck clicked, it puts all the cards in the reserve deck to the clicked deck, so I need a little bit of help on this,
so if someone knows how to make something similar to the first image above, it would be awesome.
You’ll need to provide some screen shots of the events around the click and move card actions. We can’t know how you’ve coded it or what is wrong.
This is what I have coded:
Note that the second image is the external event of the image above.
What extension are you using?
Card is into the stack of Reserve do? And does it identify only one card? Or all the cards in the reserve?
To me, this would seem to be the place to look first, and get just one of the cards from the reserve.
I’m using the Object Stack extension.
I think it does nothing because removing it nothing happens. And also in the Card System example when removing that also nothing happens.
It identifies all the cards in the reserve, and I don’t know why.
I’ve had a look at the example project, and spotted the problem. You’re checking if the mouse point is inside the deck, when it should be checking if the mouse point is inside a Card.
This identifies one card.:
Card is into the stack of Reserve does is confirm the card is in the Reserve stack.
Yes, but the example shows something different of what I want to do, so I have replaced that line of code because I want to make something like this:
but I still can’t figure it out, since when I did that it detects all the cards in the reserve
So you want the top card from the reserve pile/stack to go to lane where you clicked? In that case, I don’t think using the Stack extension is the right option.
Instead, consider using an array of structures (the structure holding the card’s suit and face value as key-value pairs), and then just selecting a random card from the array when there is a mouse click.