1.7 KiB
1.7 KiB
YeetGeese Architecture Notes
Core Loop
WaveRunnerreads aWaveTableResource → spawns enemies onto a sharedNavigationRegion2Dpath.- Player drags a tower placement cursor → confirms → instantiates a tower scene at the grid cell.
- Towers run a continuous
find_target()→ callfire()→ spawn a goose projectile fromProjectileSpawner. - Geese travel to the target, deal damage, and grant currency on kill.
Key Design Choices
- Stats as Resources: Every balanceable value (damage, fire rate, enemy HP) lives in
.tres/.tresfiles, not hardcoded. This keeps tuning non-invasive. - Signals over polling: Towers emit
target_acquired, enemies emithealth_changed, HUD listens via%HUD. No frame-polling managers. - Placement grid decoupled from navigation: The buildable area is a
Vector2igrid checked against_can_build_at(). Pathfinding uses Godot's built-inNavigationServer2D.
Scene Expectations (for AI)
- Tower:
TowerBase.gd(Node2D) with childProjectileSpawner(Marker2D) andTargetFinder. - Enemy:
EnemyMob.gdextendingArea2D, uses_ready()to assign a path via$NavigationPath2D.bake_path_from_parent(). - Projectile:
Goose.gdextendingRigidBody2DorCharacterBody2Dwith linear velocity toward target.
Data Flow Example
# WaveRunner creates an enemy from a resource
var mob_scene = enemy_res.instantiate().tree_entered.connect(_on_mob_spawned)
add_child(mob_scene)
# Tower acquires and fires
func fire_at(target: Node2D) -> void:
var goose := projectile_res.instantiate() as Goose
add_child(goose)
goose.yeet_from($ProjectileSpawner.global_position, target.global_position)