From ea3124d9ad99637a80354553e400511dba817513 Mon Sep 17 00:00:00 2001 From: Clifton Palmer Date: Sun, 14 Nov 2021 15:59:36 -0600 Subject: [PATCH] Made plane feel better --- main.tscn | 3 +++ player/player.gd | 20 +++++++++----------- project.godot | 4 ++++ 3 files changed, 16 insertions(+), 11 deletions(-) diff --git a/main.tscn b/main.tscn index 9ab4da0..f7f4093 100644 --- a/main.tscn +++ b/main.tscn @@ -15,5 +15,8 @@ transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 10.6742, 0, 0 ) [node name="CSGBox3" type="CSGBox" parent="boxes"] transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -11.353, 0, 0 ) +[node name="CSGBox4" type="CSGBox" parent="boxes"] +transform = Transform( 111, 0, 0, 0, 1, 0, 0, 0, 111, 0, -11, 0 ) + [node name="arwing" parent="." instance=ExtResource( 1 )] transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -0.0547695, 0, 35.9027 ) diff --git a/player/player.gd b/player/player.gd index 53bd3ed..b8d2b3b 100644 --- a/player/player.gd +++ b/player/player.gd @@ -1,9 +1,9 @@ extends KinematicBody -const SPEED_FORWARD = 5 -const SPEED_TURN = 60 -const SPEED_AIM = PI / 4 -const FRICTION = 0.99 +const SPEED_FORWARD = 2 +const SPEED_TURN = 120 +const SPEED_AIM = PI / 2 +const FRICTION = 0.95 var velocity = Vector3() @@ -27,25 +27,23 @@ func get_player_input(delta): velocity += SPEED_TURN * -vec_vertical * delta if Input.is_action_pressed("player_aim_up"): - rotate_x(SPEED_AIM * delta) + rotate_object_local(Vector3.RIGHT, SPEED_AIM * delta) elif Input.is_action_pressed("player_aim_down"): - rotate_x(-SPEED_AIM * delta) + rotate_object_local(Vector3.RIGHT, -SPEED_AIM * delta) if Input.is_action_pressed("player_aim_left"): - rotate_y(SPEED_AIM * delta) + rotate(Vector3.UP, SPEED_AIM * delta) elif Input.is_action_pressed("player_aim_right"): - rotate_y(-SPEED_AIM * delta) + rotate(Vector3.UP, -SPEED_AIM * delta) func _process(delta): # get velocity changes player asks for get_player_input(delta) - velocity.x *= FRICTION - velocity.y *= FRICTION # move foward according to the camera's POV var vec_forward = transform.basis.z velocity += SPEED_FORWARD * -vec_forward * delta -func _physics_process(delta): +func _physics_process(_delta): velocity = move_and_slide(velocity, Vector3.UP) diff --git a/project.godot b/project.godot index 291ec92..06fec1f 100644 --- a/project.godot +++ b/project.godot @@ -14,6 +14,10 @@ config/name="star-foxy" run/main_scene="res://main.tscn" config/icon="res://icon.png" +[global] + +draw=false + [input] player_up={ -- 2.47.2