How do I deal cards

0 favourites
  • 5 posts
From the Asset Store
Be quick and count the cards and choose the right number!
  • I have made an function for shuffling a deck of cards and dealing them. I'm trying to deal a poker hand to 4 players (a hand consisting of two cards each). I have this as my events:

    *note: I was repeating three times for testing purposes, it should be 2

    However, this only deals one card, or at least one visible card to each player, as shown:

    Why are two overlapping cards not being dealt to each player?

  • Hey

    As for me it seems like you are placing the 2 objects at the exact same position, so maybe they're just on the same spot ?

    Or do i missunderstand the question? ^^

  • So the x coordinate of the player's card is defined as so:

    WindowWidth/2 + (repeat * (CardFront.Width/2))

    which should set it as the centre of the screen, width wise, with a shift to the right of half a card width for every card dealt. They shouldn't be in the same place as the variable repeat increases by one for every time a full rotation through the players is completed.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • This is now solved, It was because the local variable was re-defined as 0 every loop

  • Perfectly ^^

    Dunno if i helped, but tried ^^

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