Skip to main content

Overview

Nyuron Color is a Simon-style memory game where players observe and replicate increasingly long sequences of colored crabs flashing. The sequence length determines the score, creating a pure test of sequential working memory. Scene Path: res://minigames/nyuron_color/scripts/main.gd

Cognitive Skills Developed

  • Working Memory: Holding sequences of 5-15+ items in mind
  • Sequential Processing: Remembering order as well as content
  • Sustained Attention: Focusing for progressively longer sequences
  • Pattern Recognition: Identifying repeating subsequences
  • Motor Memory: Developing finger-tap patterns

How to Play

Controls

  • Tap Crab: Click/tap any of the four colored crabs
  • Back Button: Pause game

Objective

Watch the sequence of flashing crabs, then replicate it by tapping crabs in the same order. Each successful replication adds one more color to the sequence.

Gameplay Flow

  1. Observation Phase: Watch crabs flash in sequence (“Observa…”)
  2. Replication Phase: Tap crabs to match the sequence (“Tu turno”)
  3. Success: One more color added to sequence
  4. Failure: Game ends; sequence length = score

Scoring System

Sequence Length as Score

var sequence: Array[String] = []

func _next_round() -> void:
    score_label.text = "Puntaje: %d" % sequence.size()
Score equals the length of the current sequence. Starting at 1, increasing by 1 each round.

Coin Conversion

var coins_earned = int(sequence.size() * 20.0)
score_manager.add_coins(coins_earned)
Coins = 20x sequence length Examples:
  • Sequence of 5: 100 coins
  • Sequence of 10: 200 coins
  • Sequence of 15: 300 coins

High Score Tracking

score_manager.save_high_score("nyuron_color", sequence.size())
Saved under key “nyuron_color” in global ScoreManager.

Color System

Available Colors

var colors: Array[String] = ["red", "blue", "green", "yellow"]

@onready var crabs := {
    "red": $Crabs/CrabRed,
    "blue": $Crabs/CrabBlue,
    "green": $Crabs/CrabGreen,
    "yellow": $Crabs/CrabYellow
}
Four distinct colors mapped to crab characters.

Key Code Examples

Sequence Generation

func _add_color_to_sequence() -> void:
    var new_color: String = colors[randi() % colors.size()]
    sequence.append(new_color)
    print("Secuencia actual:", sequence)
Random color added each round using uniform distribution.

Sequence Playback

func _play_sequence() -> void:
    showing_sequence = true
    game_started = false
    player_input.clear()
    info_label.text = "Observa..."

    for color in sequence:
        if crabs.has(color):
            crabs[color]._flash()
            await get_tree().create_timer(0.6).timeout

    showing_sequence = false
    game_started = true
    info_label.text = "Tu turno"
    print("Tu turno, secuencia esperada:", sequence)
Timing:
  • Each crab flash: instantaneous
  • Delay between flashes: 0.6 seconds
  • Total playback time: sequence.size() * 0.6 seconds

Input Validation

func _on_crab_pressed(color: String) -> void:
    if panel.visible or is_paused:
        return
    
    if showing_sequence or not game_started or is_processing_input:
        return

    is_processing_input = true  # Prevent double-taps
    player_input.append(color)
    crabs[color]._flash()

    var index := player_input.size() - 1
    
    # Check if current input matches sequence
    if player_input[index] != sequence[index]:
        _game_over()
        is_processing_input = false
        return

    # Check if full sequence completed
    if player_input.size() == sequence.size():
        await get_tree().create_timer(0.5).timeout 
        _next_round()
    
    await get_tree().create_timer(0.1).timeout
    is_processing_input = false
Key Features:
  • Immediate Validation: Each tap checked against sequence
  • Input Locking: is_processing_input prevents rapid double-taps
  • Progressive Feedback: No indication if tap is correct until sequence completes

Double-Tap Prevention

var is_processing_input := false

if showing_sequence or not game_started or is_processing_input:
    return

is_processing_input = true
# ... process input ...
await get_tree().create_timer(0.1).timeout
is_processing_input = false
Critical for touch interfaces where accidental double-taps are common.

Crab Component

Each crab is an Area2D with: Required Signal:
signal crab_pressed(color: String)
Required Method:
func _flash() -> void:
    # Visual/audio feedback for flash
    # Implementation varies by crab
Connection:
for c in colors:
    crabs[c].connect("crab_pressed", Callable(self, "_on_crab_pressed"))

Round Progression

func _next_round() -> void:
    game_started = false
    showing_sequence = true
    score_label.text = "Puntaje: %d" % sequence.size()
    info_label.text = "Bien hecho!"
    await get_tree().create_timer(1.0).timeout
    _add_color_to_sequence()
    await _play_sequence()
Timing Breakdown:
  1. Success feedback: 1.0 seconds
  2. Add new color
  3. Play updated sequence: sequence.size() * 0.6 seconds
  4. Player turn begins

Game Over Logic

func _game_over() -> void:
    if sequence.size() > 0:
        var score_manager = get_node("/root/ScoreManager")
        if score_manager:
            score_manager.save_high_score("nyuron_color", sequence.size())
            var coins_earned = int(sequence.size() * 20.0)
            score_manager.add_coins(coins_earned)

    game_started = false
    showing_sequence = true
    info_label.text = ""
    score_lbl.text = "Puntaje: %d" % sequence.size()
    title.text = "Fallaste"
    panel.visible = true

    print("Fallo. Secuencia era:", sequence, "| Jugador puso:", player_input)
Debug output shows exactly where player failed.

Pause System

func pause_game():
    is_paused = true
    showing_sequence = true  # Block input
    game_started = false     # Block input

    for color in colors:
        if crabs.has(color):
            crabs[color].input_pickable = false
            crabs[color].set_process(false)
            var sprite = crabs[color].get_node("AnimatedSprite2D")
            if sprite and sprite.is_playing():
                sprite.pause()

    panel.visible = true
    title.text = "Pausa"
    score_lbl.text = "Puntaje: %d" % sequence.size()
Critical: Both showing_sequence and game_started set to prevent input during pause.

Resume Handling

func resume_game():
    is_paused = false

    if not showing_sequence:
        game_started = true  # Only enable if not mid-sequence

    for color in colors:
        if crabs.has(color):
            crabs[color].input_pickable = true
            crabs[color].set_process(true)
            var sprite = crabs[color].get_node("AnimatedSprite2D")
            if sprite and not sprite.is_playing():
                sprite.play()

    if title.text == "Pausa":  # Don't hide game over screen
        panel.visible = false
Smart resume: doesn’t re-enable input if sequence was playing when paused.

Memory Capacity Research

Nyuron Color tests the limits of working memory:
  • Average Adult Capacity: 7±2 items (Miller’s Law)
  • Child Capacity (5-8 years): 4-5 items
  • Expert Players: 10-15 items with chunking strategies
Chunking Example: Sequence [red, red, blue, yellow, blue] can be remembered as “double red, blue, yellow, blue” (4 chunks vs 5 items).

Screen Configuration

DisplayServer.window_set_size(Vector2i(270, 480))
DisplayServer.screen_set_orientation(DisplayServer.SCREEN_PORTRAIT)
Standard portrait mode with crabs arranged in a 2x2 grid.

Difficulty Analysis

Sequence Length Difficulty

LengthDifficultyTypical Player
1-3TrivialEveryone
4-6EasyMost children
7-9ModerateOlder children/adults
10-12HardAdults with focus
13-15Very HardExperienced players
16+ExtremeTop 5% players

Minimum Possible Score

sequence.size() = 1  # First round, one color added
# Player fails immediately
# Score = 1, Coins = 20

Theoretical Maximum

No hard limit, but human working memory caps practical maximum around 15-20 items.

Strategy Tips

Players can improve by:
  1. Verbalization: Saying colors aloud (“red, blue, blue, green…”)
  2. Spatial Mapping: Associating positions (“top-left, bottom-right…”)
  3. Rhythmic Grouping: Breaking long sequences into 3-4 item chunks
  4. Motor Memory: Letting fingers “remember” tap patterns
  5. Full Attention: Eliminating distractions during observation phase

Memorice

Spatial memory matching game

Minigames Overview

Return to all minigames

Build docs developers (and LLMs) love