Ajout de textures proto et control de souris.

This commit is contained in:
Victor Turgeon
2022-10-11 08:39:11 -04:00
parent f2437d51ef
commit 7b7452e8e5
161 changed files with 2828 additions and 0 deletions

14
Player.gd Normal file
View File

@@ -0,0 +1,14 @@
extends KinematicBody
var mouse_sensitivity = 0.03
onready var head = $Head
func _ready():
Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
func _input(event):
if event is InputEventMouseMotion:
rotate_y(deg2rad(-event.relative.x * mouse_sensitivity))
head.rotate_x(deg2rad(-event.relative.y * mouse_sensitivity))
head.rotation.x = clamp(head.rotation.x, deg2rad(-89), deg2rad(89))