[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 )
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()
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)