How rthurmed/ceifador works
Project type and purpose
• This is a Godot‐based 2D action/shooter game (“Ceifador”) built with Godot v3.5.2.
• Purpose: the player moves, shoots magic bullets, drains enemy souls to gain energy, advances through stages and boss battles.
File structure
• Top level:
• project.godot – main Godot project file.
• assets/ – all art/sfx/music/fonts/animations.
• modules/ – reusable Godot modules (Debugging, Juice animations, Pause, StateMachine).
• src/ – all game scenes (.tscn) and scripts (.gd) organized by feature.
• src/ subfolders:
• common/ – generic gameplay elements (Bullet, Gun, Health).
• enemy/ – enemy scenes, boss folder, pattern folder.
• player/ – player scene, bullet, steal‐area.
• stages/ – Stage base class + individual levels and boss battles.
• util/ – utility scripts (AutoPathFollow, RandomPitchAudio, Util).
• Modules implement cross‐cutting concerns (state machine, camera juice effects, pause, debugging).
Architectural patterns and technologies
• Godot scene‐node system: each .tscn is a prefab with a root node and attached GDScript.
• Composition over inheritance: scenes assemble nodes (Player, Enemies, UI).
• State Machine module for enemy & game state transitions.
• “Juice” module for camera/shake/blink effects.
• Signal‐based communication between nodes (e.g. Player emits “shot,” Stage listens, UI updates).
Main components and interactions
a. Core runtime components:
• Game Manager / Main scene – orchestrates transitions (Intro → Stages → Outro).
• Stage Manager – instantiates StageX.tscn, spawns enemies, listens for stage complete.
• Player – handles input, movement, shooting, energy count.
• Enemy – various types plus boss, each with AI patterns via StateMachine.
• Projectiles – PlayerBullet, EnemyBullet as separate scenes.
• Collectibles – soul drops, health jars (DropHP, Drop).
• Audio Manager – plays music (Soundtrack.tscn) and SFX with RandomPitchAudio.
• Modules – DebugNode for debug overlay, Juice for camera feedback, Pause controls.
b. Data flows and relationships:
• Input → Player script → Movement, shooting → spawn PlayerBullet → physics collisions
• PlayerBullet → collides with Enemy → Enemy state machine → “die” → spawn Drop → emits “soul collected” → Player energy++ → UI updates
• Stage Manager listens for all enemies dead → next Stage or BossBattle scene.
• Pause module intercepts input to freeze game time.
• Juice module listens for events (hit, death) → triggers camera shake/blink.
• Audio Manager plays music loop, SFX on signals (shoot, hit, death).
c. Architectural patterns:
• Scene‐node composition (Godot standard)
• Modular plugins (modules/) for reusable functionality
• State machine for behavior isolation
• Event/signal‐driven communication