extends Camera3D
@export_group("Movimiento y Cámara")
@export var speed: float = 5.0
@export var mouse_sensitivity: float = 0.003
@export_group("Límites de Desplazamiento (Metros)")
@export var limit_forward: float = 10.0 # Máximo W (Adelante)
@export var limit_backward: float = 5.0 # Máximo S (Atrás)
@export var limit_left: float = 8.0 # Máximo A (Izquierda)
@export var limit_right: float = 8.0 # Máximo D (Derecha)
var rotation_x: float = 0.0
var start_position: Vector3
func _ready() -> void:
Input.mouse_mode = Input.MOUSE_MODE_CAPTURED
start_position = global_position
func _unhandled_input(event: InputEvent) -> void:
if event.is_action_pressed("ui_cancel") or (event is InputEventKey and event.pressed and event.keycode == KEY_ESCAPE):
get_tree().quit()
if event is InputEventMouseMotion and Input.mouse_mode == Input.MOUSE_MODE_CAPTURED:
rotate_y(-event.relative.x * mouse_sensitivity)
rotation_x -= event.relative.y * mouse_sensitivity
rotation_x = clamp(rotation_x, deg_to_rad(-89.0), deg_to_rad(89.0))
rotation.x = rotation_x
func _process(delta: float) -> void:
var input_dir := Vector3.ZERO
if Input.is_key_pressed(KEY_W):
input_dir.z -= 1 # W: Adelante
if Input.is_key_pressed(KEY_S):
input_dir.z += 1 # S: Atrás
if Input.is_key_pressed(KEY_A):
input_dir.x -= 1 # A: Izquierda
if Input.is_key_pressed(KEY_D):
input_dir.x += 1 # D: Derecha
if input_dir != Vector3.ZERO:
input_dir = input_dir.normalized()
# Movemos en el plano horizontal para no volar al mirar arriba/abajo
var forward := -global_transform.basis.z
forward.y = 0
forward = forward.normalized()
var right := global_transform.basis.x
right.y = 0
right = right.normalized()
# Calculamos el intento de movimiento
var movement := (right * input_dir.x + forward * -input_dir.z) * speed * delta
var target_position := global_position + movement
# Medimos la distancia acumulada desde el origen
var offset := target_position - start_position
# Aplicamos los 4 límites independientes (W, S, A, D)
offset.x = clamp(offset.x, -limit_left, limit_right)
offset.z = clamp(offset.z, -limit_forward, limit_backward)
# Asignamos la posición corregida manteniendo la altura fija (Y)
global_position = Vector3(start_position.x + offset.x, start_position.y, start_position.z + offset.z)

← Return to game
Comentarios
The wolfman is a superstar, you should continue the series or make a spirituals successor like the new adventures of MMMesaltmalomalal. You should also add sex, violence and a little bit of your sense of humor, like the lady in the pink suit with her panties down:)
None of that can be done anymore, everything’s censored. It’s a disgrace, but they don’t even show it for free on itch.io anymore. It wouldn’t even appear on the lists. What’s the point of making games that nobody’s going to look at? And that they won’t let me sell?
Follow me if you’d like at https://perico415.itch.io/. I’ll try to keep going with horror games if they don’t ban them too…
You are right sadly, but I like the fact that you didn't give up. Maybe new platforms will appear in time. Best of luck in your projects!