small racing game im working on
clear skids on reset
bendn 2023-03-07
parent 492c728 · commit f3de436
-rw-r--r--classes/car.gd9
-rw-r--r--export_presets.cfg4
2 files changed, 9 insertions, 4 deletions
diff --git a/classes/car.gd b/classes/car.gd
index d094976..16fd6ea 100644
--- a/classes/car.gd
+++ b/classes/car.gd
@@ -27,6 +27,7 @@ var current_gear := 0 # -1 reverse, 0 = neutral, 1 - 6 = gear 1 to 6.
var clutch_position := 1 # 0.0 = clutch engaged
var gear_timer := 0.0
var throttle := 0.0
+const inactive = {active = false};
var skids: Array[Array]
func ratio() -> float:
@@ -50,11 +51,17 @@ func reset() -> void:
engine_force = 0
brake = 15
set_physics_process(false)
+ for wheel in skids:
+ if wheel:
+ for skid in wheel:
+ if skid is Trail3D:
+ skid.queue_free()
+ wheel.clear()
+ skids = [[inactive], [inactive], [inactive], [inactive]] # performance and complexity hack
func _ready() -> void:
for whl in wheels:
particles.append(whl.get_node(^"particles"))
- skids.append([{active = false}]) # performance and complexity hack
randomize()
func kph():
diff --git a/export_presets.cfg b/export_presets.cfg
index 09e544e..ca67d22 100644
--- a/export_presets.cfg
+++ b/export_presets.cfg
@@ -4,7 +4,7 @@ name="Linux/X11"
platform="Linux/X11"
runnable=true
dedicated_server=false
-custom_features=""
+custom_features="release"
export_filter="all_resources"
include_filter=""
exclude_filter=""
@@ -25,7 +25,6 @@ texture_format/bptc=false
texture_format/s3tc=true
texture_format/etc=false
texture_format/etc2=false
-texture_format/no_bptc_fallbacks=true
binary_format/architecture="x86_64"
ssh_remote_deploy/enabled=false
ssh_remote_deploy/host="user@host_ip"
@@ -160,7 +159,6 @@ texture_format/bptc=false
texture_format/s3tc=true
texture_format/etc=false
texture_format/etc2=false
-texture_format/no_bptc_fallbacks=true
binary_format/architecture="x86_64"
codesign/enable=false
codesign/identity_type=0