$ a resource management tower defense game where energy is currency and health
Solar Charged is a tower defense game built with a partner for the 2025 Kenny Game Jam. The theme was "Power." Energy acts as both currency and health: you spend it to place towers, towers cost upkeep while on the field (and more while actively shooting), and solar panels recharge it over time based on weather conditions. If your energy hits zero, you lose.
Tower types include a basic shooter, a piercing laser, an area damage tower, an energy buff tower that boosts adjacent towers, and a slow tower. Each has two independent upgrade tracks with three levels each.
The goal is to manage your power effectively while defending against waves of enemies. Strategically place and upgrade towers, but keep in mind: the more towers you have and the more you upgrade them, the more power they consume. If you run out of power, you lose.
Your power is recharged through solar energy, which is affected by the weather cycle. Keep an eye on the forecast. To open the upgrade menu, select a placed tower. You can also delete towers this way. Upkeep is the passive cost of having a tower on the field; this cost increases when the tower is actively shooting.
The game is divided into five explicit game states managed by a StateMachine class: MainMenu, Placing
(drag-to-place towers), Combat (waves active), Shop (between waves), and Win/Lose. Each state is a
separate class inheriting from a State base, with enter(), exit(), and
update() methods. Transitions are triggered by events (wave cleared, energy depleted,
shop confirmed) and the state machine calls the appropriate lifecycle hooks.
Energy is managed through a single HealthComponent shared between the currency and health systems. Tower placement deducts from it; passive and active upkeep drain it each tick; solar recovery adds back at a rate determined by the current weather. The weather cycle transitions between Rain, Cloudy, Normal, and Sunny states using weighted random selection, giving Sunny the highest probability (50%) and Rain the lowest (7%). Weather state determines the per-tick energy recovery multiplier.
Enemy movement uses PathFollow2D nodes along pre-authored paths. Tower targeting logic checks enemies within range and prioritizes by progress along the path, hitting the one closest to the end.
The first game built with explicit state machines and component-based design rather than singletons. The difference in maintainability was immediately apparent. Some key takeaways: