removed the horror aspect from the old project

This commit is contained in:
2024-01-17 11:55:15 +01:00
parent c0f0048705
commit ee3852fec0
5 changed files with 20 additions and 18 deletions

View File

@@ -2,19 +2,24 @@ extends CharacterBody3D
const SPEED = 5.0
const JUMP_VELOCITY = 4.5
var gravity: float = ProjectSettings.get_setting("physics/3d/default_gravity")
@onready var camera: Camera3D = $Camera3D
@onready var light: SpotLight3D = $Camera3D/SpotLight3D
var camera_senitivity: float = 0.5
func _ready() -> void:
capture()
func _physics_process(delta: float) -> void:
if not is_on_floor():
velocity.y -= gravity * delta
if Input.is_action_just_pressed("jump") and is_on_floor():
velocity.y = JUMP_VELOCITY
var input_dir := Input.get_vector("move_left", "move_right", "move_forward", "move_backward")
var direction := (transform.basis * Vector3(input_dir.x, 0, input_dir.y)).normalized()
if direction:
@@ -35,8 +40,6 @@ func _input(event: InputEvent) -> void:
capture(false)
if event.is_action_pressed("mouse_capture"):
capture()
if event.is_action_pressed("flashlight"):
light.visible = !light.visible
func _notification(what: int) -> void: