scanlines, sounds, bumper walls, score keep, control legend, timer
This commit is contained in:
@@ -4,6 +4,7 @@ extends Camera3D
|
||||
@export var horizontal_distance: float = 18.0
|
||||
@export var horizontal_angle_deg: float = 45.0
|
||||
@export var ortho_size: float = 15.0
|
||||
@export var ortho_size_max: float = 40.0
|
||||
|
||||
const _FLASH_DURATION: float = 0.30
|
||||
|
||||
@@ -11,11 +12,13 @@ var _shake_amount: float = 0.0
|
||||
var _shake_decay: float = 0.0
|
||||
var _flash_timer: float = 0.0
|
||||
var _flash_rect: ColorRect = null
|
||||
var _target_size: float = 0.0
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
set_as_top_level(true)
|
||||
projection = PROJECTION_ORTHOGONAL
|
||||
_target_size = ortho_size
|
||||
size = ortho_size
|
||||
_setup_flash()
|
||||
|
||||
@@ -31,7 +34,15 @@ func _setup_flash() -> void:
|
||||
canvas.add_child(_flash_rect)
|
||||
|
||||
|
||||
func _unhandled_input(event: InputEvent) -> void:
|
||||
if event.is_action_pressed("zoom_in"):
|
||||
_target_size = clamp(_target_size / 1.2, ortho_size, ortho_size_max)
|
||||
if event.is_action_pressed("zoom_out"):
|
||||
_target_size = clamp(_target_size * 1.2, ortho_size, ortho_size_max)
|
||||
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
size = lerpf(size, _target_size, delta * 10.0)
|
||||
var angle_rad := deg_to_rad(horizontal_angle_deg)
|
||||
var offset := Vector3(
|
||||
sin(angle_rad) * horizontal_distance,
|
||||
|
||||
Reference in New Issue
Block a user