mirror of
https://github.com/jcreek/CosmicClash.git
synced 2026-09-13 12:42:05 +00:00
feat(audio): add wall contact cue
This commit is contained in:
@@ -197,6 +197,7 @@ signal thrust_changed(thrust_percent: float)
|
||||
signal angular_velocity_changed(angular_speed: float)
|
||||
signal heading_changed(heading_degrees: float)
|
||||
signal ball_contact(intensity: float, world_position: Vector3)
|
||||
signal wall_contact(intensity: float)
|
||||
|
||||
# Performance optimization - track last emitted values to avoid unnecessary signals
|
||||
var _last_speed: float = -1.0
|
||||
@@ -415,6 +416,8 @@ func is_turbo_active() -> bool:
|
||||
|
||||
|
||||
func _on_body_entered(body: Node) -> void:
|
||||
if body is StaticBody3D:
|
||||
wall_contact.emit(clampf(linear_velocity.length() / maxf(max_speed, 0.001), 0.0, 1.0))
|
||||
if not body is Ball:
|
||||
return
|
||||
var relative_speed := (linear_velocity - (body as Ball).linear_velocity).length()
|
||||
|
||||
Reference in New Issue
Block a user