On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags
(+1)

Hi Mate, glad you liked the game. Here's how I would fix the issue you're having.

Have a controller object in charge of picking up. 

When the player clicks it loops through all the cards to check if they're being clicked on.

If a card hasn't been picked up yet then pick it up. If it has then compare the depth of the card already held with the one trying to be picked up and drop the old one if it's lower.

OR you can loop through all the cards from highest card to lowest and stop at the first card which is under the mouse. You'd just have to sort all the cards be their depth for that.

Hope one of those ways works for you!

(2 edits)

I understand you, but I am faced with the problem(again) of the distribution of the depth of the cards. I dont know how to do it.

P.S "Sorry to take up your time" :) . I just had such a good idea. but I do not know how to implement it

(1 edit)

No worries, I'm happy to help. I can probably help you easier in DM, do you wanna add me on discord? 

yes