diff --git a/README.md b/README.md index aefbd68..dfd665f 100644 --- a/README.md +++ b/README.md @@ -86,7 +86,10 @@ When a player reveals all 6 cards, others get one final turn. Lowest score wins. - `blackjack` - Score of exactly 21 becomes 0 ### Gameplay Options -- `flip_on_discard` - Must flip a card when discarding from deck +- `flip_mode` - What happens when discarding from deck: + - `never` - Standard (no flip) + - `always` - Speed Golf (must flip after discard) + - `endgame` - Suspense (optional flip when any player has ≤1 face-down card) - `use_jokers` - Add Jokers to deck - `eagle_eye` - Paired Jokers score -8 instead of canceling diff --git a/client/app.js b/client/app.js index 7a840a2..475921c 100644 --- a/client/app.js +++ b/client/app.js @@ -138,8 +138,13 @@ class GolfGame { this.deckRecommendation = document.getElementById('deck-recommendation'); this.numRoundsSelect = document.getElementById('num-rounds'); this.initialFlipsSelect = document.getElementById('initial-flips'); - this.flipOnDiscardCheckbox = document.getElementById('flip-on-discard'); + this.flipModeSelect = document.getElementById('flip-mode'); this.knockPenaltyCheckbox = document.getElementById('knock-penalty'); + + // Rules screen elements + this.rulesScreen = document.getElementById('rules-screen'); + this.rulesBtn = document.getElementById('rules-btn'); + this.rulesBackBtn = document.getElementById('rules-back-btn'); // House Rules - Point Modifiers this.superKingsCheckbox = document.getElementById('super-kings'); this.tenPennyCheckbox = document.getElementById('ten-penny'); @@ -170,6 +175,7 @@ class GolfGame { this.discard = document.getElementById('discard'); this.discardContent = document.getElementById('discard-content'); this.discardBtn = document.getElementById('discard-btn'); + this.skipFlipBtn = document.getElementById('skip-flip-btn'); this.playerCards = document.getElementById('player-cards'); this.playerArea = this.playerCards.closest('.player-area'); this.swapAnimation = document.getElementById('swap-animation'); @@ -193,6 +199,7 @@ class GolfGame { this.deck.addEventListener('click', () => { this.playSound('card'); this.drawFromDeck(); }); this.discard.addEventListener('click', () => { this.playSound('card'); this.drawFromDiscard(); }); this.discardBtn.addEventListener('click', () => { this.playSound('card'); this.discardDrawn(); }); + this.skipFlipBtn.addEventListener('click', () => { this.playSound('click'); this.skipFlip(); }); this.nextRoundBtn.addEventListener('click', () => { this.playSound('click'); this.nextRound(); }); this.newGameBtn.addEventListener('click', () => { this.playSound('click'); this.newGame(); }); this.addCpuBtn.addEventListener('click', () => { this.playSound('click'); this.showCpuSelect(); }); @@ -236,6 +243,30 @@ class GolfGame { } }); } + + // Rules screen navigation + if (this.rulesBtn) { + this.rulesBtn.addEventListener('click', () => { + this.playSound('click'); + this.showRulesScreen(); + }); + } + if (this.rulesBackBtn) { + this.rulesBackBtn.addEventListener('click', () => { + this.playSound('click'); + this.showLobby(); + }); + } + } + + showRulesScreen(scrollToSection = null) { + this.showScreen(this.rulesScreen); + if (scrollToSection) { + const section = document.getElementById(scrollToSection); + if (section) { + section.scrollIntoView({ behavior: 'smooth' }); + } + } } connect() { @@ -367,7 +398,12 @@ class GolfGame { case 'can_flip': this.waitingForFlip = true; - this.showToast('Flip a face-down card', '', 3000); + this.flipIsOptional = data.optional || false; + if (this.flipIsOptional) { + this.showToast('Flip a card or skip', '', 3000); + } else { + this.showToast('Flip a face-down card', '', 3000); + } this.renderGame(); break; @@ -450,7 +486,7 @@ class GolfGame { const initial_flips = parseInt(this.initialFlipsSelect.value); // Standard options - const flip_on_discard = this.flipOnDiscardCheckbox.checked; + const flip_mode = this.flipModeSelect.value; // "never", "always", or "endgame" const knock_penalty = this.knockPenaltyCheckbox.checked; // Joker mode (radio buttons) @@ -475,7 +511,7 @@ class GolfGame { decks, rounds, initial_flips, - flip_on_discard, + flip_mode, knock_penalty, use_jokers, lucky_swing, @@ -757,6 +793,15 @@ class GolfGame { flipCard(position) { this.send({ type: 'flip_card', position }); this.waitingForFlip = false; + this.flipIsOptional = false; + } + + skipFlip() { + if (!this.flipIsOptional) return; + this.send({ type: 'skip_flip' }); + this.waitingForFlip = false; + this.flipIsOptional = false; + this.hideToast(); } // Fire-and-forget animation triggers based on state changes @@ -1164,6 +1209,9 @@ class GolfGame { this.lobbyScreen.classList.remove('active'); this.waitingScreen.classList.remove('active'); this.gameScreen.classList.remove('active'); + if (this.rulesScreen) { + this.rulesScreen.classList.remove('active'); + } screen.classList.add('active'); } @@ -1566,6 +1614,13 @@ class GolfGame { this.discardBtn.classList.remove('disabled'); } + // Show/hide skip flip button (only when flip is optional in endgame mode) + if (this.waitingForFlip && this.flipIsOptional) { + this.skipFlipBtn.classList.remove('hidden'); + } else { + this.skipFlipBtn.classList.add('hidden'); + } + // Update scoreboard panel this.updateScorePanel(); } diff --git a/client/index.html b/client/index.html index 93ffe81..0dc4e33 100644 --- a/client/index.html +++ b/client/index.html @@ -12,6 +12,7 @@

🏌️ Golf

6-Card Golf Card Game

+
@@ -99,11 +100,15 @@

Variants

- +
+ + + What happens when you draw from deck and discard +
+
@@ -288,6 +294,202 @@ + +
+
+ +

Game Rules

+ +
+

Basic Rules

+

6-Card Golf is a card game where players try to achieve the lowest score over multiple rounds ("holes"). Like golf, lower is better!

+
    +
  • Each player has 6 cards arranged in a 2-row by 3-column grid
  • +
  • Most cards start face-down (hidden from everyone)
  • +
  • On your turn: draw one card, then either swap it with one of yours or discard it
  • +
  • When any player reveals all 6 of their cards, everyone else gets one final turn
  • +
  • After all rounds ("holes") are played, the player with the lowest total score wins
  • +
+
+ +
+

Card Values

+ + + + + + + + + + + + +
CardPointsNotes
Joker-2Best card! (requires Jokers to be enabled)
2-2Excellent - gives you negative points!
Ace (A)1Very low and safe
King (K)0Zero points - great for making pairs!
3 through 10Face value3=3 pts, 4=4 pts, ..., 10=10 pts
Jack (J), Queen (Q)10High cards - replace these quickly!
+
+ +
+

Column Pairing (IMPORTANT!)

+

This is the most important rule to understand:

+

If both cards in a vertical column have the same rank (like two Kings, or two 7s), that entire column scores 0 points - regardless of what the cards are worth individually!

+ +
+

Example:

+
+Your 6-card grid:
+  Col1  Col2  Col3
+ [K]   [5]   [7]   ← Top row
+ [K]   [3]   [9]   ← Bottom row
+
+Column 1: K + K = PAIR! = 0 points (not 0+0)
+Column 2: 5 + 3 = 8 points
+Column 3: 7 + 9 = 16 points
+
+TOTAL: 0 + 8 + 16 = 24 points
+
+ +

IMPORTANT: When you pair cards, you get 0 points for that column - even if the cards have negative values! Two 2s paired = 0 points (not -4). Two Jokers paired = 0 points (not -4).

+
+ +
+

Turn Structure (Step by Step)

+ +

Step 1: Draw a Card

+

You MUST draw exactly one card. Choose from:

+
    +
  • The Deck (face-down pile) - You don't know what you'll get!
  • +
  • The Discard Pile (face-up pile) - You can see exactly what card you're taking
  • +
+ +

Step 2: Use or Discard the Card

+ +
+

If you drew from the DECK:

+

You have two options:

+
    +
  • SWAP: Replace any one of your 6 cards with the drawn card. The old card goes to the discard pile.
  • +
  • DISCARD: Put the drawn card directly on the discard pile without using it.
  • +
+
+ +
+

If you drew from the DISCARD PILE:

+

You MUST swap - you cannot put the same card back on the discard pile.

+
+
+ +
+

Flip on Discard Rules (3 Modes)

+

This setting affects what happens when you draw from the deck and choose to discard (not swap):

+ +
+

Standard Mode (No Flip)

+

Default setting. Discarding ends your turn immediately.

+

How it works: When you draw from the deck and decide not to use it, you simply discard it and your turn is over. Nothing else happens.

+

Best for: Traditional gameplay, longer games, maximum hidden information.

+
+ +
+

Speed Golf Mode (Must Flip)

+

Every discard reveals one of your hidden cards.

+

How it works: When you draw from the deck and discard, you MUST also flip over one of your face-down cards. This is mandatory - you cannot skip it.

+

Why use it: Games go much faster because more cards get revealed every turn. More information for everyone = more strategic decisions.

+

Best for: Quick games, players who like faster-paced action.

+
+ +
+

Suspense Mode (Optional Flip Near Endgame)

+

Optional flip activates when any player is close to finishing.

+

How it works:

+
    +
  • Early in the round: Discarding ends your turn (like Standard mode)
  • +
  • When ANY player has 1 or fewer face-down cards: After discarding, you MAY choose to flip one of your hidden cards OR skip the flip
  • +
+

Why use it: Creates dramatic tension near the end of rounds. Do you reveal more to try to improve your score, or keep cards hidden to maintain mystery?

+

Best for: Players who enjoy dramatic finishes and tough end-game decisions.

+
+
+ +
+

House Rules (Optional Variants)

+ +

Point Modifiers

+
    +
  • Super Kings: Kings are worth -2 points instead of 0 (makes them even better!)
  • +
  • Ten Penny: 10s are worth only 1 point instead of 10 (makes 10s less scary)
  • +
+ +

Joker Variants

+
    +
  • Standard Jokers: 2 Jokers per deck, each worth -2 points (paired Jokers = 0 points)
  • +
  • Lucky Swing: Only 1 Joker in the entire deck, but it's worth -5 points! (Rare and powerful)
  • +
  • Eagle Eye: Jokers are worth +2 points unpaired, but -4 points when paired (rewards finding both Jokers)
  • +
+ +

Bonuses & Penalties

+
    +
  • Knock Penalty: If you "go out" (reveal all cards first) but DON'T have the lowest score, you get +10 penalty points. Risk vs reward!
  • +
  • Knock Bonus: Get -5 points (subtracted from your score) for going out first.
  • +
  • Underdog Bonus: The player with the lowest score each hole gets -3 points.
  • +
  • Tied Shame: If you tie with another player's score, both of you get +5 penalty points.
  • +
  • Blackjack: If your exact score is 21, it becomes 0 instead!
  • +
  • Wolfpack: If you have exactly 2 pairs of Jacks (all 4 Jacks), you get -5 bonus points.
  • +
+
+ +
+

Frequently Asked Questions

+ +
+

Q: Can I look at my face-down cards?

+

A: No! Once the game starts, you cannot peek at your own face-down cards. You only see them when they get flipped face-up (either by swapping or by the flip-on-discard rule).

+
+ +
+

Q: Can I swap a face-down card without looking at it first?

+

A: Yes! In fact, that's often the best strategy - if you have a card that seems high based on probability, swap it out before you even see it.

+
+ +
+

Q: What happens when someone reveals all their cards?

+

A: Once ANY player has all 6 cards face-up, every other player gets exactly ONE more turn. Then the round ends and scores are calculated.

+
+ +
+

Q: Do I have to go out (reveal all cards) to win?

+

A: No! You can win the round even with face-down cards. The player with the lowest score wins, regardless of how many cards are revealed.

+
+ +
+

Q: When do pairs count?

+

A: Pairs only count in VERTICAL columns (top card + bottom card in the same column). Horizontal or diagonal matches don't create pairs.

+
+ +
+

Q: Can I make a pair with face-down cards?

+

A: Face-down cards are still counted for scoring, but since you can't see them, you're gambling that they might form a pair. At the end of the round, all cards are revealed and pairs are calculated.

+
+ +
+

Q: What if the deck runs out of cards?

+

A: The discard pile (except the top card) is shuffled to create a new deck.

+
+ +
+

Q: In Suspense mode, when exactly can I flip?

+

A: The optional flip activates the moment ANY player (including you) has 1 or fewer face-down cards remaining. From that point until the round ends, whenever you discard from the deck, you'll get the option to flip or skip.

+
+ +
+

Q: Why would I NOT flip in Suspense mode?

+

A: Maybe you have a hidden card you hope is good, and you don't want to reveal a potential disaster. Or maybe you want to keep your opponents guessing about your score. It's a strategic choice!

+
+
+
+
+ +