How do I deal cards

Get help using Construct 2

Post » Mon Sep 01, 2014 6:56 pm

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:
Image
*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:
Image

Why are two overlapping cards not being dealt to each player?
Last edited by briggybros on Wed Sep 03, 2014 3:37 pm, edited 1 time in total.
Nothing goes unanswered!
B
24
S
5
G
1
Posts: 434
Reputation: 3,446

Post » Wed Sep 03, 2014 11:07 am

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? ^^
B
7
S
1
Posts: 55
Reputation: 810

Post » Wed Sep 03, 2014 3:42 pm

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.
Nothing goes unanswered!
B
24
S
5
G
1
Posts: 434
Reputation: 3,446

Post » Wed Sep 03, 2014 3:45 pm

This is now solved, It was because the local variable was re-defined as 0 every loop
Nothing goes unanswered!
B
24
S
5
G
1
Posts: 434
Reputation: 3,446

Post » Wed Sep 03, 2014 3:53 pm

Perfectly ^^
Dunno if i helped, but tried ^^
B
7
S
1
Posts: 55
Reputation: 810


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 26 guests