]> Untitled Git - star-foxy.git/commitdiff
Made plane feel better
authorClifton Palmer <clifton.james.palmer@protonmail.com>
Sun, 14 Nov 2021 21:59:36 +0000 (15:59 -0600)
committerClifton Palmer <clifton.james.palmer@protonmail.com>
Sun, 14 Nov 2021 22:29:23 +0000 (16:29 -0600)
main.tscn
player/player.gd
project.godot

index 9ab4da02cdb032b521726ba758c1cce57e144808..f7f409338a8d8cbe5da81c46fbfe891c2701eac0 100644 (file)
--- 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 )
index 53bd3ed500259114a93cd216d6d67f71cb75e0cb..b8d2b3b3b1f16fbe6da8aeba46b9108ec045430d 100644 (file)
@@ -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)
index 291ec923ca0daa84de1b9209a45c3996fced5bb2..06fec1fdb107be8b372a4ea2c11e53945038d11d 100644 (file)
@@ -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={