From 731c55b70f6d4c29a8ddaac229272caa4bd30084 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Fri, 26 Jul 2024 18:51:21 +0200 Subject: refactor environment effects --- client/map/environment.gd | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'client/map') diff --git a/client/map/environment.gd b/client/map/environment.gd index f36b51b6..abe8ed6c 100644 --- a/client/map/environment.gd +++ b/client/map/environment.gd @@ -1,10 +1,13 @@ extends Node3D -func update(params: Dictionary): - $Wind.emitting = params["wind"] > 0.1 - var a: ParticleProcessMaterial = $Wind.process_material - a.initial_velocity_max = params["wind"] * 15. - a.initial_velocity_min = params["wind"] * 15. +func update(active: Array): - $Rain.emitting = params["rain"] > 0.1 - $Rain.amount = params["rain"] * 500 + $Wind.emitting = active.has("wind") + var a: ParticleProcessMaterial = $Wind.process_material + # TODO ramp + a.initial_velocity_max = 15. if active.has("wind") else 0. + a.initial_velocity_min = 15. if active.has("wind") else 0. + + # TODO ramp + $Rain.emitting = active.has("rain") + $Rain.amount = 500 if active.has("rain") else 0 -- cgit v1.2.3-70-g09d2