fix(gameplay): escape pause menu + block placement collision + perf optim render_distance/throttling

This commit is contained in:
Floppyrj45
2026-04-19 17:32:59 +02:00
parent 3fa02492a2
commit 9546fcd96b
8 changed files with 164 additions and 21 deletions

View File

@@ -77,13 +77,6 @@ func _setup_input_actions() -> void:
ev.button_index = mouse_actions[action_name]
InputMap.action_add_event(action_name, ev)
if not InputMap.has_action("escape"):
InputMap.add_action("escape")
var ev := InputEventKey.new()
ev.keycode = KEY_ESCAPE
InputMap.action_add_event("escape", ev)
func _input(event: InputEvent) -> void:
if event is InputEventMouseMotion and Input.get_mouse_mode() == Input.MOUSE_MODE_CAPTURED:
var motion := event as InputEventMouseMotion
@@ -107,11 +100,6 @@ func _input(event: InputEvent) -> void:
_do_raycast_place()
if event.is_action_pressed("echolocate"):
_trigger_echolocation()
if event.is_action_pressed("escape"):
if Input.get_mouse_mode() == Input.MOUSE_MODE_CAPTURED:
Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE)
else:
Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
func _physics_process(delta: float) -> void:
@@ -252,9 +240,9 @@ func _raycast(reach: float) -> Dictionary:
func take_damage(amount: float) -> void:
health = max(0.0, health - amount)
emit_signal("stats_changed", oxygen, health, hunger)
stats_changed.emit(oxygen, health, hunger)
if health <= 0.0:
emit_signal("player_died")
player_died.emit()
func _trigger_echolocation() -> void: