godot-plateformer/_shared/camera/GlobalCamera.gd

25 lines
751 B
GDScript3
Raw Normal View History

2026-01-06 11:58:41 +08:00
class_name GlobalCamera extends Node2D
@onready var phantom_camera_2d: PhantomCamera2D = %PhantomCamera2D
2026-01-06 23:18:36 +08:00
@onready var _0_hook_touch_noise: PhantomCameraNoiseEmitter2D = %"0_Hook_Touch_Noise"
@onready var _45_hook_touch_noise: PhantomCameraNoiseEmitter2D = %"45_Hook_Touch_Noise"
@onready var _90_hook_touch_noise: PhantomCameraNoiseEmitter2D = %"90_Hook_Touch_Noise"
@onready var _135_hook_touch_noise: PhantomCameraNoiseEmitter2D = %"135_Hook_Touch_Noise"
func emit_camera_shock(noise: PhantomCameraNoise2D) -> void:
if not noise:
return
func emit_hook_touch_shock(dir : int) -> void:
match dir:
0:
_0_hook_touch_noise.emit()
1:
_45_hook_touch_noise.emit()
2:
_90_hook_touch_noise.emit()
3:
_135_hook_touch_noise.emit()