Skip to content

[FEATURE] Convert Hard-Coded Fuel Elements to Godot Resource #281

Description

@ikostan

Description:
Convert fuel-related hard-coded values in player.gd (e.g., max_fuel=100.0, consumption_rate) to a Godot Resource for easier modularity and balancing.

Why is this useful?

  • Learning Godot: Demonstrates Resource usage for configurable data.
  • Extensibility: Simplifies tweaking values without code changes.
  • Balancing: Enables runtime or editor-based adjustments.

Proposed Implementation:

  1. Create FuelConfig.tres with fields: max_fuel (100.0), consumption_rate (1.0), thresholds (90/50/30/15%).
  2. Load resource in Player.gd _ready(): var fuel_config = load("res://resources/FuelConfig.tres").
    The FuelConfig concept was intentionally merged into GameSettingsResource to prevent code fragmentation and simplify the save/load architecture.
  3. Replace hard-coded values with fuel_config.max_fuel, etc.
  4. Update logic to emit signals on changes.

Additional Context:
Aligns with signal enhancements; supports future power-ups.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

Status
Done

Relationships

None yet

Development

No branches or pull requests

Issue actions