close
Skip to content

Add Konami code invulnerability easter egg - #4

Merged
leereilly merged 5 commits into
mainfrom
copilot/add-konami-code-invulnerability
Jan 27, 2026
Merged

Add Konami code invulnerability easter egg#4
leereilly merged 5 commits into
mainfrom
copilot/add-konami-code-invulnerability

Conversation

Copilot AI commented Jan 27, 2026

Copy link
Copy Markdown
Contributor

Implements Konami code (↑ ↑ ↓ ↓ ← → ← → B A) as an easter egg that grants invulnerability. When activated, enemies deal no damage.

Changes

  • State tracking (game/state.go): Added KonamiSequence []string and Invulnerable bool to GameState. Tracks last 10 key presses and matches against Konami pattern.

  • Damage prevention (game/state.go): Modified enemyAttacks() to return early when invulnerable.

  • Input handling (game/game.go): Arrow keys and 'b'/'a' keys now feed into sequence detection via CheckKonamiCode().

  • UI feedback (game/game.go): Status bar displays "INVULNERABLE" when active. Activation shows message: "KONAMI CODE ACTIVATED! You are now invulnerable!"

Example

// CheckKonamiCode tracks key sequence and activates invulnerability
func (gs *GameState) CheckKonamiCode(key string) {
    konamiCode := []string{"up", "up", "down", "down", "left", "right", "left", "right", "b", "a"}
    gs.KonamiSequence = append(gs.KonamiSequence, key)
    
    if len(gs.KonamiSequence) > 10 {
        gs.KonamiSequence = gs.KonamiSequence[len(gs.KonamiSequence)-10:]
    }
    
    if len(gs.KonamiSequence) == 10 && matches(gs.KonamiSequence, konamiCode) {
        gs.Invulnerable = true
    }
}

Tests cover correct/incorrect sequences and damage mechanics with/without invulnerability.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • dl.google.com
    • Triggering command: /update-job-proxy /update-job-proxy (dns block)
    • Triggering command: /update-job-proxy /update-job-proxy DROP noffline test -e cation_Authority.pem noffline /opt/go/bin/test submodules | hea/usr/bin/git -trimpath git test -e CA_v1.pem /home/REDACTED/go/pkg/mod/golang.o/usr/share/ca-certificates/mozilla/Autoridad_de_Certificacion_Filist /bin/test -bool -buildtags mi-code-invulner-t test (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

If the Konami code is entererd, the player becomes invulnerable. Monsters do no damage.

Created from Copilot CLI via the copilot delegate command.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 4 commits January 27, 2026 01:45
Co-authored-by: leereilly <121322+leereilly@users.noreply.github.com>
Co-authored-by: leereilly <121322+leereilly@users.noreply.github.com>
Co-authored-by: leereilly <121322+leereilly@users.noreply.github.com>
Co-authored-by: leereilly <121322+leereilly@users.noreply.github.com>
@leereilly

Copy link
Copy Markdown
Owner

@leereilly
leereilly marked this pull request as ready for review January 27, 2026 01:48
Copilot AI changed the title [WIP] Add invulnerability feature for Konami code Add Konami code invulnerability easter egg Jan 27, 2026
@leereilly
leereilly merged commit 02b37f6 into main Jan 27, 2026
Copilot AI requested a review from leereilly January 27, 2026 01:49
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