Video Poker for Arduboy

Video Poker

Source code and pre-built binaries available on GitHub: https://github.com/delpozzo/videopoker-arduboy

About

A 5-card poker game for Arduboy ported from the Gamebuino version.

videopoker-small

Controls

  • Left, Right - Card selection.
  • Up, Down - Increase / Decrease bet.
  • A Button - Hold / Unhold card.
  • B Button - Deal / Draw.
  • Left + Right - Pause menu (press Left and Right at the same time).

To upload a new game, hold Up while powering on your Arduboy to enter flashlight mode.

Gameplay

During the bet round, use Up or Down to increase or decrease your bet. The minimum bet is $5 and the maximum is $100. Press B to deal the cards. Select cards using Left or Right. Press A to toggle Hold on the selected card. Press B to exchange unheld cards for new ones from the deck.

Winning hands and rewards are as follows:

Royal Flush: 250 x Bet

Straight Flush: 50 x Bet

Four of a Kind: 25 x Bet

Full House: 9 x Bet

Flush: 6 x Bet

Straight: 4 x Bet

Three of a Kind: 3 x Bet

Two Pair: 2 x Bet

Pair of Jacks or Better: 1 x Bet

6 Likes

Unfortunately the screenshot did not show up!

The code you are pointing to seems to still reference the Gamebuino library. Excuse my ignorance but is this a hacked version that runs on the Arduboy?

Edit: The image placeholder seems to have disappeared.

The video is great though. Can you post it into this forum?

Hey @filmote, thanks for your reply! I originally wrote this game for the Gamebuino Classic / MAKERbuino and ported it over using @akkera102’s Gamebuino Library for Arduboy. Sorry about the large size of the animated gif screenshot, I compressed it and resized it so hopefully this works:

videopoker-small

Nice one. The new video shows off the features nicely.

2 Likes

Perfect game for the Arduboy! Love video poker!

1 Like

I like it! :+1: (just one note - the Arduboy2 library uses the first 16 bytes of EEPROM for system settings, so if you write there then it can mess up those settings for other sketches that use it…)

1 Like

Just in case you didn’t know, the typedef is completely redundant here:

typedef struct CARD_S
{
  byte suit; // CLUBS, DIAMONDS, HEARTS, or SPADES
  byte value; // 2-10, J, Q, K, or A
  byte state; // INDECK, DRAWN, HELD, or DISCARDED
  int flipTimer; // Timer for flipping card
} Card;

This could have been written as:

struct Card
{
  byte suit; // CLUBS, DIAMONDS, HEARTS, or SPADES
  byte value; // 2-10, J, Q, K, or A
  byte state; // INDECK, DRAWN, HELD, or DISCARDED
  int flipTimer; // Timer for flipping card
};

And it would have had the exact same effect.
The typedef struct thing is only (sort of) needed in C,
in C++ it’s redundant because of the different rules for refering to structs.

2 Likes

Thanks for the heads up @uXe, that is good to know! I plan on eventually updating this to use the Arduboy2 libraries when I get a chance.

Good catch @Pharap, you are 100% correct! Guilty as charged - I come from a C game engine development background-- I guess the saying old habits die hard is relevant in this situation :sweat_smile:

1 Like