hadean-godot/CameraController.gd

13 lines
313 B
GDScript
Raw Permalink Normal View History

2025-10-13 09:57:17 -04:00
extends Camera2D
func _process(delta):
const speed = 300.0
if Input.is_key_pressed(KEY_W):
position.y -= delta * speed
if Input.is_key_pressed(KEY_S):
position.y += delta * speed
if Input.is_key_pressed(KEY_A):
position.x -= delta * speed
if Input.is_key_pressed(KEY_D):
position.x += delta * speed