(Solved) How do I create a hand of cards like hearthstone

  • Hey guys, so I'm working on a card game and obviously that's some serious work lol I been working on trying to create a hand of cards like the ccg hearthstone. You draw a card and it gets added to your hand, you draw another card and the one you have slides over to make room for the next card then they slide back when a card is played and so on. obviously you gotta set hand limits too.

    I tried things like set card at offset, set position to this and so on but I can't get the cards set correctly in my hand like in hearthstone. It looks like the cards are on the field and I don't want that haha I'm thinking some kinda Lerp might have to be created and the cards gotta be set in a way so it looks like a hand and not in the filed of play So yeah if anyone knows how I can accomplish a hand system like hearthstone... the ideas, tips, pointers or tutorials you can point me to would be greatly appreciated, thanks everyone!

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • With some trig you could set it up like an arc in Hearthstone.

    In a loop, I would set the angle to ((360/number of possible cards)*loopindex)+offset

    With the formula: x = centerX + cos(angle) * distance, y = centerY + sin(angle) * distance

    The z should take care of itself.

  • With some trig you could set it up like an arc in Hearthstone.

    In a loop, I would set the angle to ((360/number of possible cards)*loopindex)+offset

    With the formula: x = centerX + cos(angle) * distance, y = centerY + sin(angle) * distance

    The z should take care of itself.

    Thanks, i'll test this out and see if it works for me.

  • With some trig you could set it up like an arc in Hearthstone.

    In a loop, I would set the angle to ((360/number of possible cards)*loopindex)+offset

    With the formula: x = centerX + cos(angle) * distance, y = centerY + sin(angle) * distance

    The z should take care of itself.

    Yeah that didn't work for me. it just placed the cards all in one spot and then they just got set at different angels as they got dealt out so I gotta look for other options or find out if I made a mistake on your idea.

  • Might try this as a cheat.

  • Might try this as a cheat.

    That looks good but like some of the people said... the plug-in won't load. This is like one of the hardest but i'm sure really simple things i'm trying to add lol I bet i'll just laugh whenever I figure this out if it ends up being something stupid to make this card hand thing work. Thanks for all the efforts to help

  • Het mikewalton206!

    Here's an example with some functions that might be useful for your card game, including the updateHand, which sets position and angle to each card on the player's hand according to the amount of cards and the player hand area.

    https://www.dropbox.com/s/anbtxlrdk2n1l ... .capx?dl=1

    Every function has a help text so you can figure out how it works.

    Hope this helps. Cheers!

  • Het mikewalton206!

    Here's an example with some functions that might be useful for your card game, including the updateHand, which sets position and angle to each card on the player's hand according to the amount of cards and the player hand area.

    https://www.dropbox.com/s/anbtxlrdk2n1l ... .capx?dl=1

    Every function has a help text so you can figure out how it works.

    Hope this helps. Cheers!

    OMG!!! Yes! you are the best LOL this will for sure get me started in the right direction. I really appreciate it!!!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)