summary refs log tree commit diff stats
path: root/racing
diff options
context:
space:
mode:
authorStar Rauchenberger <fefferburbia@gmail.com>2024-02-08 21:49:04 -0500
committerStar Rauchenberger <fefferburbia@gmail.com>2024-02-08 21:49:04 -0500
commit2ce58f86aa74f1fd904690cb3ba3438bee4b765f (patch)
treed2c180fee4219a9ebf1e7bbc39d1312af1f95056 /racing
parent18868c978b56e14f11a700c33fe8572fd953a16f (diff)
downloadlingo-race-2ce58f86aa74f1fd904690cb3ba3438bee4b765f.tar.gz
lingo-race-2ce58f86aa74f1fd904690cb3ba3438bee4b765f.tar.bz2
lingo-race-2ce58f86aa74f1fd904690cb3ba3438bee4b765f.zip
start spin, not in ground
Diffstat (limited to 'racing')
-rw-r--r--racing/lobby.gd3
-rw-r--r--racing/player.gd19
2 files changed, 21 insertions, 1 deletions
diff --git a/racing/lobby.gd b/racing/lobby.gd index 10fefb6..38402de 100644 --- a/racing/lobby.gd +++ b/racing/lobby.gd
@@ -84,6 +84,7 @@ func _ready():
84 84
85 if global.get_node_or_null("RaceManager") == null: 85 if global.get_node_or_null("RaceManager") == null:
86 installScriptExtension(ResourceLoader.load("user://maps/racing/load.gd")) 86 installScriptExtension(ResourceLoader.load("user://maps/racing/load.gd"))
87 installScriptExtension(ResourceLoader.load("user://maps/racing/player.gd"))
87 88
88 var race_manager_script = load("user://maps/racing/manager.gd") 89 var race_manager_script = load("user://maps/racing/manager.gd")
89 var race_manager = race_manager_script.new() 90 var race_manager = race_manager_script.new()
@@ -414,7 +415,7 @@ func _start_game():
414 Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED) 415 Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
415 global.map = "level1" 416 global.map = "level1"
416 global.entry_point = Vector3( 417 global.entry_point = Vector3(
417 race_manager.start_pos[1], race_manager.start_pos[2] + 0.25, race_manager.start_pos[3] 418 race_manager.start_pos[1], race_manager.start_pos[2] + 1, race_manager.start_pos[3]
418 ) 419 )
419 global.entry_rotate = Vector3(0, 0, 0) 420 global.entry_rotate = Vector3(0, 0, 0)
420 global.sets_entry_point = true 421 global.sets_entry_point = true
diff --git a/racing/player.gd b/racing/player.gd new file mode 100644 index 0000000..95220c1 --- /dev/null +++ b/racing/player.gd
@@ -0,0 +1,19 @@
1extends "res://scripts/player.gd"
2
3
4func _unhandled_input(event):
5 ._unhandled_input(event)
6
7 # Checks specifically for *not* playable. On purpose.
8 if event is InputEventMouseMotion and !playable and !solving:
9 rotate_y(-event.relative.x * mouse_sensitivity)
10 if global.invert_y_axis:
11 pivot.rotate_x(event.relative.y * mouse_sensitivity)
12 else:
13 pivot.rotate_x(-event.relative.y * mouse_sensitivity)
14 pivot.rotation.x = clamp(pivot.rotation.x, -1.5, 1.5)
15
16
17func _solving():
18 if playable:
19 ._solving()