How do I create poker game?

Get help using Construct 2

Post » Sun Apr 19, 2015 6:16 pm

@DjPoke

I'm trying to implement what you're telling me to do, but i cant.
I use capx which @korbaach uploaded here.

I'm adding 2 cards for players, and i have no idea how to compare all that cards. Can you help me with that on this capx example?
Thank you.
B
4
Posts: 10
Reputation: 220

Post » Mon Apr 20, 2015 5:54 am

Today and tomorrow, i have not the time, but if you can wait theese two days, i'll take a look at the capx file.
Construct 2, an easy way to do great things.
B
17
S
5
G
2
Posts: 43
Reputation: 1,328

Post » Mon Apr 20, 2015 7:09 am

@DjPoke
Sure, thanks.
I very appreciate this.
B
4
Posts: 10
Reputation: 220

Post » Tue Apr 21, 2015 6:09 am

@kelney
Right, this is done.
http://www.retro-bruno.com/downloads/Poker.capx

I've changed a lot of things...
I'm programming like a cro magnon... lol

EDIT:
New version optimized, same link.

EDIT2:
Added some functions, you can really play now. :-)
Construct 2, an easy way to do great things.
B
17
S
5
G
2
Posts: 43
Reputation: 1,328

Post » Tue Apr 21, 2015 8:43 am

@DjPoke

Great working example :)
Sure, the events could be optimized, but I actually like seeing it this way, for it's easier to read.
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Tue Apr 21, 2015 3:17 pm

@DjPoke

Wow, thanks. That's a really playable example.
But i still don't understand how should it works, if i want to add 2-3 players for example.
How to compare they're cards? There should be 5 cards as there are now, and 2 additional for each player.
And after that compare who has better combination?

Maby, that's noob's questions for you, but for me it's seems very complicated right now :(
B
4
Posts: 10
Reputation: 220

Post » Tue Apr 21, 2015 3:39 pm

When i've time, i will create an example with two players.
For now, i explain to you.

You just have to add 5 cards for each player first.
In each card, there is an instance variable called "CardNumber" (1,2,3,4 & 5 for the first player).
Create for example 5 more cards, and change the "CardNumber" vars for these to 6,7,8,9,10.
Duplicate some parts of the block of events and paste it after.
(You'll have to create an A.I for the other players)
Change the reference to the 1,2,3,4,5 cards to access the 6,7,8,9,10 cards.
Duplicate vars and arrays you need for each player and edit the events.

Once you've done that, you have to replace the events that show what you have in your hand by a comparison, as explained before.
There is a variable, at the end, which contain the value of what you have. (TWO PAIRS, THREE OF A KIND, etc...)
Juste compare this var to the same var duplicated for each player, and you'll know who win.
In case of equality, you'll have to compare the sorted hands arrays.

I don't understand why you talk about 2 additional cards for each players.
Do you mean that only two cards can be replaced ?
Because i don't know a poker game with 7 cards in a hand.
Can you explain further.
Construct 2, an easy way to do great things.
B
17
S
5
G
2
Posts: 43
Reputation: 1,328

Post » Tue Apr 21, 2015 5:21 pm

Not 7 in hand :)

5 on table, and 2 in each player hand.
B
4
Posts: 10
Reputation: 220

Post » Tue Apr 21, 2015 5:49 pm

It's Done. I hope there is no bugs...
http://www.retro-bruno.com/downloads/Poker2.capx

Ok, i understand what kind of poker you talk about.
I will see tomorrow what i can do.
Construct 2, an easy way to do great things.
B
17
S
5
G
2
Posts: 43
Reputation: 1,328

Post » Wed Apr 22, 2015 3:45 am

kelney, i'm sorry, i think i don't help you by this way.

This is some rules you need to know :
1) To progress, you must practice. The more you practice, the more you progress.
2) To progress quickly, you must be methodic, with your logic.
3) To progress well, you must know your subject.

Example:
1) You want to program an existing type of game ? Learn perfectly the rules. As this, you know your subject.
2) Use your logic to plan how to program the game.
- At first, create prototypes with only the medias you need to see if your ideas are functional.
- When you see it works, you can create your game.
- Don't forget to make clean programs, ordered, and with a lot of useful comments.
3) If you miss, never forget you can retry, and by retrying you give yourself more chances to win.

I hope i'm useful.
If you have any questions about the game, you can post it here, i'm here. :)
But i prefer you to try first to do your best, and then i can help you.

Ah, i forget something important, we will have to be patients.
This is the quality all people must have to succeed in life. :)
Construct 2, an easy way to do great things.
B
17
S
5
G
2
Posts: 43
Reputation: 1,328

PreviousNext

Return to How do I....?

Who is online

Users browsing this forum: brunopalermo, maxwell88, TELLES0808 and 4 guests