Skip to content

[Sprig App] Simon Says Button Edition! - #4099

Open
prakhar-gamer wants to merge 1 commit into
hackclub:mainfrom
prakhar-gamer:Automated-PR-1785266108847
Open

[Sprig App] Simon Says Button Edition!#4099
prakhar-gamer wants to merge 1 commit into
hackclub:mainfrom
prakhar-gamer:Automated-PR-1785266108847

Conversation

@prakhar-gamer

Copy link
Copy Markdown

Author name

Author: prakhar-gamer

About your game

What is your game about?
The game has a random amount of rounds that you have to predict the right order, if you get it wrong it plays the sequence animation again, and marks that as wrong for a split secound. When u win it shows you only the correct buttons, and a little celeberation Text!

How do you play your game?
W A S D - To control the hovered buttons
i - to select a button!

Copilot AI review requested due to automatic review settings July 28, 2026 19:15
@vercel

vercel Bot commented Jul 28, 2026

Copy link
Copy Markdown

@prakhar-gamer is attempting to deploy a commit to the Hack Club Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions

Copy link
Copy Markdown

[Auto Triage] PR detected. Apply submission label to run validation.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds a new Sprig game implementing a “Simon Says” memory sequence using a 3×3 button grid navigated by WASD and selected with i.

Changes:

  • Introduces sprites/bitmaps for button states (base, hover, guessed, clicked, wrong, won).
  • Generates a random-length sequence and plays it back as an animation.
  • Implements hover navigation + guessing logic with win/lose handling.
Comments suppressed due to low confidence (3)

games/Simon-Says-Button-Edition!.js:238

  • playSequence() calls setMap(buttonGrid) after buttons/chosenButtons are built from sprites created by the initial setMap. In Sprig, setMap recreates sprites, so later .type changes (clicked/wrong) are applied to stale sprite objects and won’t visually update the grid. Avoid resetting the map here (or rebuild buttons/chosenButtons from the new map).
function playSequence() {
//plays the animation at the start and on mistake of the blue sprites
 setMap(buttonGrid)
 start = false
  for (let r = 0; r < chosenButtons.length; r++){

games/Simon-Says-Button-Edition!.js:167

  • The else {} block after checking pickedButton is empty; removing it avoids dead code and makes the intent clearer.
  if (pickedButton) {
    chosenButtons.push(pickedButton)
  } else {
  }

games/Simon-Says-Button-Edition!.js:174

  • hoveringButton and buttonVal are declared but never used; removing unused variables reduces confusion and prevents lint warnings.
let start = false
var hoveringButton
var buttonVal = 0

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +146 to +162
//per round buttons
const avaliableButtons = buttons.slice()
const chosenButtons = []


//picks the buttons that are gonna be the goal
for (let i = 0; i < randRounds; i++) {
if (avaliableButtons.length === 0) {
console.log("No buttons left to pick.")
break
}

//rand amount of buttons
const randIndex = Math.floor(Math.random() * avaliableButtons.length)

const pickedButton = avaliableButtons.splice(randIndex, 1)[0]

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.

2 participants