Improves tree and ground tile appearance
Refactors tree spawning and rendering: - Adds seasonal color variations for trees via scripts. - Introduces `ColorStorage` to manage tree and grass colors - Removes unused code from tree spawning logic. - Adjusts ground tile color for better visual appeal. - Hides debug text on ground tiles.
This commit is contained in:
parent
734730beee
commit
ea5006e8a2
28 changed files with 454 additions and 63 deletions
|
|
@ -14,10 +14,40 @@ extends Resource
|
|||
@export_group("Growth Properties")
|
||||
@export var max_height: float = 15.0
|
||||
@export var growth_time: float = 120.0 # Seconds to full growth
|
||||
@export var spawn_probability: float = 0.1
|
||||
@export var spread_radius: float = 5.0
|
||||
|
||||
@export_group("Seasonal Behavior")
|
||||
@export var seasonal_models: Array[PackedScene] = [] # Spring, Summer, Fall, Winter
|
||||
@export var drops_leaves: bool = true
|
||||
@export var leaf_color_variations: Array[Color] = []
|
||||
|
||||
@export_group("Tree Color Management")
|
||||
@export var color_script: GDScript = null
|
||||
|
||||
@export_group("Leaf Colors")
|
||||
@export var spring_leaf_color: Color = Color(0.0, 1.0, 0.0) # Green
|
||||
@export var summer_leaf_color: Color = Color(0.0, 0.5, 0.0) # Darker green
|
||||
@export var autumn_leaf_color: Color = Color(1.0, 0.5, 0.0) # Orange
|
||||
@export var winter_leaf_color: Color = Color(0.5, 0.5, 0.5) # Gray/Brown
|
||||
|
||||
@export_group("Trunk Colors")
|
||||
@export var spring_trunk_color: Color = Color(0.6, 0.4, 0.2) # Brown
|
||||
@export var summer_trunk_color: Color = Color(0.5, 0.3, 0.1) # Darker brown
|
||||
@export var autumn_trunk_color: Color = Color(0.4, 0.2, 0.1) # Darker brown
|
||||
@export var winter_trunk_color: Color = Color(0.3, 0.2, 0.1) # Very dark brown
|
||||
|
||||
func apply_seasonal_colors(instance_model: Node3D, season: String = "summer") -> void:
|
||||
if color_script == null:
|
||||
return
|
||||
|
||||
var script_instance = color_script.new()
|
||||
|
||||
# Pass the tree name and season to the color script
|
||||
if script_instance.has_method("set_tree_info"):
|
||||
script_instance.set_tree_info(tree_name, season)
|
||||
|
||||
|
||||
if script_instance.has_method("set_leaf_color"):
|
||||
script_instance.set_leaf_color(instance_model)
|
||||
if script_instance.has_method("set_trunk_color"):
|
||||
script_instance.set_trunk_color(instance_model)
|
||||
Loading…
Add table
Add a link
Reference in a new issue