|
extends Camera2D
|
|
|
|
|
|
@export var move_speed: int = 250
|
|
@export var zoom_increment: Vector2 = Vector2(0.1, 0.1)
|
|
|
|
|
|
func _process(delta: float) -> void:
|
|
var input_dir := Input.get_vector("Left", "Right", "Up", "Down")
|
|
var velocity_y = input_dir.y * move_speed * delta
|
|
var velocity_x = input_dir.x * move_speed * delta
|
|
|
|
position += Vector2(velocity_x, velocity_y)
|
|
|
|
func _unhandled_input(event: InputEvent) -> void:
|
|
if event.is_action_pressed("Reset Zoom"):
|
|
zoom = Vector2.ONE
|
|
if event.is_action_pressed("Zoom In"):
|
|
zoom += zoom_increment
|
|
if event.is_action_pressed("Zoom Out"):
|
|
zoom -= zoom_increment
|