Skip to content

set game (early WIP)#2

Draft
sebastiansandqvist wants to merge 5 commits into
onsclom:mainfrom
sebastiansandqvist:seb/set
Draft

set game (early WIP)#2
sebastiansandqvist wants to merge 5 commits into
onsclom:mainfrom
sebastiansandqvist:seb/set

Conversation

@sebastiansandqvist
Copy link
Copy Markdown

@sebastiansandqvist sebastiansandqvist commented Jul 19, 2024

rough starting point for the Set game

basic plan:

  • 2-player game
  • both players see the same cards on the field
  • start with 12 cards like https://www.setgame.com/set/puzzle
    • increase # displayed if there are no valid sets or if users request one (tbd: limitations on user requests. max field size?)
  • be able to render cards with...
    • color: [red, green, blue]
    • fill: [solid, dashed, outline]
    • count: [1, 2, 3]
    • shape: [S, O, diamond]
  • display "score" for each player. score = # of cards collected
  • handle logic for determining valid sets
  • allow players to select/deselect cards
  • once 3 cards are selected, validate them and either remove from field with random cards to replace them or keep on field and flash red for invalid
  • todo: figure out how to handle 2 players selecting the same card(s). maybe just display and allow both selections?
  • show deck on the table. visual deck height for remaining card count.
  • handle gameover

Comment thread src/menu.ts

let game = null as null | keyof typeof games;
// let game = null as null | (typeof games)[number];
let game = games[2] as null | (typeof games)[number];
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

temporarily just launching straight into Set

Comment thread src/menu.ts
"bullet hell": bulletHellUpdateAndDraw,
};
const gameNames = Object.keys(games);
const games = [
Copy link
Copy Markdown
Author

@sebastiansandqvist sebastiansandqvist Jul 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

curious to get your take on using tuples instead of an object for this. it was the easiest way I could think of to fix the type error on line 95

Comment thread src/set.ts
@@ -0,0 +1,145 @@
const gameResolution = { width: 400, height: 300 };
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is all throwaway code at this point! just trying to render something to the screen as a start. includes some experiments with the dashed fill and attempting (unsuccessfully) to render an S shape.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant