Page 1 of 1

RUMMY

Posted: Fri May 17, 2024 4:28 am
by totodilespy
A version of Rummy for the X16.

I built this using a lot of the same code as I used for solitaire, so the interface / controls are similar.

CONTROLS:
Left click to select cards
Right click to unselect all cards

Click the deck to draw from the deck
Click a card in the discard pile to pick it up and all cards above it
Once a card is drawn, click the discard pile with one card selected to discard it and end your turn.

To play a match, select all the cards in the match and click the empty card shape below the deck. If your play was not a valid match, it will play a beep.

GAME RULES:
This game is more closely based on 500 rum, but should be understandable to most.

The objective of the game is to score more points than your opponent, achieved by playing 3 cards of the same rank/number or 3 cards of the same suite in a row. Once either player runs out of cards, they also add the point values of the other player's hand to their score.
Players can play off both their existing matches and the matches of their opponent.

At the start of a player's turn, they may either draw from the deck or pick up a portion of the cards from the discard pile. If they do so, they must pick up all the cards above the first card they pick up, and they must play that card to form a match this turn. (The game also checks that it is the first match you play that turn, I plan to add a message about this).
At any time the player may play matches. Once they are done, they must discard a card from their hand to the top of the discard pile (unless playing a match put them down to 0 cards in hand).

SCORING:
2-10 are worth 5 points
J,Q,K (face cards) are worth 10
Aces are worth 15 points

Hopefully this description makes sense, and you enjoy the game. If not, the wikipedia article on the rules should help: https://en.wikipedia.org/wiki/500_rum

Link to play here: Try It Now!

Re: RUMMY

Posted: Fri May 17, 2024 1:29 pm
by mwiedmann
This is great! Another awesome card game from you. I played it for about an hour and it worked great.

Minor bug report:
I ran into a edge case perhaps? I had a game where the discard pile was so long it ran off the screen and I couldn't see what was discarded and could only pick up starting from what I could see. Rare, so not a big deal. I think the draw pile then ran out of cards and suddenly the discard pile disappeared and I couldn't draw from it. I clicked it again and it discarded and said the game was over. A little weird and probably was in a glitched state but rare case as I said.

Rules question:
The CPU had a 7/8/9 clubs so I played a 6 clubs on it. Nice. The CPU then discarded a 5 clubs. I picked it up but couldn't add it to the 6/7/8/9 clubs run. Maybe you aren't allowed to bounce again like that?

Re: RUMMY

Posted: Fri May 17, 2024 5:53 pm
by totodilespy
Thanks for the feedback! I'm glad you enjoyed playing.

You should have been able to lay down that 5 of clubs, I'll try to see why that didn't work. The computer should have played the 5 of clubs itself, so there is probably something wrong with the routine to check if a match is valid.

When I was played, the discard pile never actually got past the end of the screen. When the deck runs out, it is supposed to take all but one card in the discard and make a new deck, but I never had that happen so I don't think I had the chance to check the code actually worked.
I may just add some code to end the game if the deck runs out instead of trying to fix the deck.