Skip to main content
Nyuron is built as an ecosystem of independent minigames connected through shared systems. This modular architecture enables easy maintenance, testing, and expansion without breaking existing functionality.

Architecture Overview

The game follows a modular scene-based architecture where each minigame operates as an independent, self-contained unit that interfaces with global systems.

Modular Minigames

Each minigame has its own scene, scripts, and assets

Shared Core Systems

Global autoload singletons manage scores, coins, and inventory

Consistent UI

Standardized HUD, panels, and transition screens across all games

Central Menu

Main menu serves as the navigation hub for all minigames

Project Structure

Nyuron organizes code and assets to maximize reusability and maintainability:
nyuron/
├── scenes/
│   └── main_menu.tscn              # Central navigation hub
├── scripts/
│   └── ScoreManager.gd.gd          # Autoload singleton
├── minigames/
│   ├── counting_animals/
│   │   ├── main.tscn               # Minigame scene
│   │   ├── scripts/
│   │   │   └── main.gd             # Main controller
│   │   └── assets/                 # Game-specific assets
│   ├── food_catch/
│   │   ├── main.tscn
│   │   ├── main.gd
│   │   └── assets/
│   └── [other minigames]/
└── resources/                       # Shared resources
    ├── sprites/
    ├── sounds/
    └── music/
The priority is that each minigame is modular: you can maintain, iterate, and test it without breaking the rest of the system.

Core Systems

ScoreManager Autoload

The ScoreManager autoload singleton (scripts/ScoreManager.gd.gd) provides global access to player progression data across all minigames. Key responsibilities:
  • High score tracking per minigame
  • Coin/currency management
  • Inventory and equipment system
  • Persistent save/load functionality
# From counting_animals/scripts/main.gd:376
var score_manager = get_node("/root/ScoreManager")
if score_manager:
    score_manager.save_high_score("counting_animals", final_score)

Registered Minigames

The ScoreManager maintains a dictionary of all registered minigames:
ScoreManager.gd.gd:9
var high_scores = {
    "memorice": 0,
    "turtle_runner": 0,
    "worm_catch": 0,
    "food_catch": 0,
    "counting_animals": 0,
    "nyuron_color": 0
}
When adding a new minigame, you must register its key in the high_scores dictionary in ScoreManager.gd.gd:9 or score saving will fail.

Persistent Storage

Player data is saved to user://high_scores.cfg using Godot’s ConfigFile system:
ScoreManager.gd.gd:104
func save_to_file():
    var config = ConfigFile.new()
    config.load(SAVE_PATH)
    
    for game in high_scores.keys():
        config.set_value("high_scores", game, high_scores[game])
    
    config.set_value("player_data", "coins", coins)
    config.set_value("inventory", "items", inventory)
    config.set_value("player_data", "equipped_items", equipped_items)
    
    var error = config.save(SAVE_PATH)

Minigame Structure

Every minigame follows a consistent internal structure:
1

Main Scene

Root Node2D or Node containing all game elements
2

Main Controller Script

GDScript file (main.gd) managing game logic, scoring, and state
3

UI Layer

CanvasLayer with HUD elements (score, lives, buttons)
4

Game Elements

Spawners, timers, player character, obstacles, collectibles
5

Intro/Game Over Panels

Standardized UI panels for game start and end states
6

Audio

SFX and background music specific to the minigame

Standard UI Components

All minigames implement consistent UI elements:
counting_animals/main.gd:72
intro_panel.show()
play_button.pressed.connect(_on_play_pressed)
Shows game instructions before play begins
Players navigate from the main menu to individual minigames:
# Main menu button connection (conceptual)
get_tree().change_scene_to_file("res://minigames/food_catch/main.tscn")

Returning to Main Menu

All minigames provide a back button that returns to the main menu:
food_catch/main.gd:234
func _on_back_pressed() -> void:
    DisplayServer.screen_set_orientation(DisplayServer.SCREEN_PORTRAIT)
    get_tree().root.set_content_scale_size(Vector2i(270, 480))
    get_tree().change_scene_to_file("res://scenes/main_menu.tscn")
Screen orientation and resolution are reset when returning to the main menu to ensure consistent presentation across minigames.

Mobile Optimization

Nyuron’s architecture accounts for mobile deployment:
Content scale size is adjusted per minigame (e.g., Vector2i(854, 480) for landscape games, Vector2i(270, 480) for portrait)
DisplayServer.screen_set_orientation(DisplayServer.SCREEN_LANDSCAPE)
Each minigame sets its required orientation on load
food_catch/main.gd:375
func _on_touch_input(event: InputEvent, dir: float) -> void:
    if event is InputEventScreenTouch or event is InputEventMouseButton:
        if event.pressed:
            player.touch_dir = dir
Touch areas provide mobile-friendly input
CanvasLayers with follow_viewport_enabled = true ensure UI adapts to screen size

Technology Stack

  • Engine: Godot 4.x
  • Language: GDScript
  • Art Style: 2D pixel-art
  • Scene Architecture: Independent scenes per minigame + shared UI/HUD + controllers (timers/spawners/panels)
  • Platform: Mobile-first (Android/iOS) with touch controls and adaptive resolution

Benefits of This Architecture

Easy Testing

Test minigames in isolation without loading the full game

Parallel Development

Multiple developers can work on different minigames simultaneously

Simple Expansion

Add new minigames by duplicating the standard structure

Clear Separation

Core systems and game logic are cleanly separated

Maintainable

Fix bugs or update features in one minigame without affecting others

Consistent UX

Shared UI patterns create familiar experience across all games

Build docs developers (and LLMs) love