Card game, getting started...

Get help using Construct 2

Post » Wed Jul 03, 2013 11:32 am

Hello,

I want to create a card game, so I am wondering how I should get started.

I thought I could create the cards as sprites and put them into a "Cards" family. Each card has the instance variable "value". I would shuffle them with an array of 52.

Is this a good way to do it, or do you have a better idea?

How could I implement the Dealer and Player. As a global variable "dealer value" and "player value" does not seem right.

And what is the best way to hand the cards out? How do I define and assign the cards of the player and the cards of the dealer to determine their card values later on?

Best Regards,
Astrosus.
B
8
S
2
Posts: 110
Reputation: 1,463

Post » Wed Jul 03, 2013 12:05 pm

I'd create single objects, with different cards as separate animations/frames. You could for example have animation Spades, hearts etc. with cards at frame numbers matching to the cards value. So Spade to would be at animation "Spade" at animation frame 2 and so forts. No need to use any other variables in that case, as you can see the value from animation frame.

If you decide to use arrays to handle decks and whatever, you should have array for each player(or dealer) that has the cards of that player. Thus checking the cards player has would only be going through that array.

Hope these random thoughts give you some ideas :)
B
24
S
9
G
7
Posts: 756
Reputation: 7,292

Post » Wed Jul 03, 2013 1:35 pm

I tried my best to create Blackjack, but it is not working.

I uploaded the .capx for you.

The problems:
- he does not deal the cards, only sometimes on heavy button spamming with left and right click
- when he deals the cards, the cards are all the same
- I need a better method on placing the cards in the appropriate place.
- I need a method to detect the value of the Player and Dealer hand and compare them to set winning conditions

When the player clicks on "New hand" he gets 2 cards, then the dealer gets 1 card and 1 card upside down. When the player decides to stand, the upside down card should be turned into a random card as well.

Depending on how many times the player/dealer hits (takes another card) I need to place the card in a appropriate place. I think I need about 6 to 8 card slots for the Player and the Dealer (each), but in the case the player is able to hit more often, the cards should be placed correct too.

I would really appreciate it, if you could help me to fix the problems.

Best Regards,
Astrosus.Astrosus2013-07-03 13:51:16
B
8
S
2
Posts: 110
Reputation: 1,463

Post » Sat Jul 06, 2013 3:57 am

Anyone, please?
B
8
S
2
Posts: 110
Reputation: 1,463

Post » Sat Jul 06, 2013 4:25 am

there's a card deal shuffling capx in the arcade.
B
18
S
5
G
4
Posts: 568
Reputation: 5,079

Post » Sun Jul 07, 2013 12:01 am

I can not find it. Why is there no search function for the Arcade? :(
B
8
S
2
Posts: 110
Reputation: 1,463

Post » Sun Jul 07, 2013 4:59 am

I'm on my cell so i can't open you capx but there's an example for solitaire here:
http://www.scirra.com/forum/solitaire-game-with-construct-2_topic60938_post374424.html#374424
It should still work. I forget if I commented it but at least it should help a bit.
B
89
S
30
G
95
Posts: 5,159
Reputation: 63,454


Return to How do I....?

Who is online

Users browsing this forum: 12thmix and 5 guests