summary refs log tree commit diff stats
path: root/racing/player.gd
blob: 95220c1756b6e693d91e4dacbf5d68ed296f8a3c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
extends "res://scripts/player.gd"


func _unhandled_input(event):
	._unhandled_input(event)

	# Checks specifically for *not* playable. On purpose.
	if event is InputEventMouseMotion and !playable and !solving:
		rotate_y(-event.relative.x * mouse_sensitivity)
		if global.invert_y_axis:
			pivot.rotate_x(event.relative.y * mouse_sensitivity)
		else:
			pivot.rotate_x(-event.relative.y * mouse_sensitivity)
		pivot.rotation.x = clamp(pivot.rotation.x, -1.5, 1.5)


func _solving():
	if playable:
		._solving()