--- /dev/null
+[gd_scene load_steps=2 format=2]
+
+[ext_resource path="res://player/player.tscn" type="PackedScene" id=1]
+
+[node name="world" type="Spatial"]
+
+[node name="boxes" type="Spatial" parent="."]
+
+[node name="CSGBox" type="CSGBox" parent="boxes"]
+transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 8 )
+
+[node name="CSGBox2" type="CSGBox" parent="boxes"]
+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="arwing" parent="." instance=ExtResource( 1 )]
+transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -0.0547695, 0, 35.9027 )
--- /dev/null
+extends KinematicBody
+
+const SPEED = 20
+
+var velocity = Vector3()
+
+# Called when the node enters the scene tree for the first time.
+func _ready():
+ pass # Replace with function body.
+
+func get_player_input(delta):
+ var cam_vec_lateral = $Camera.transform.basis.x
+ var cam_vec_vertical = $Camera.transform.basis.y
+
+
+ if Input.is_action_pressed("player_left"):
+ velocity += SPEED * cam_vec_lateral * delta
+ elif Input.is_action_pressed("player_right"):
+ velocity += SPEED * -cam_vec_lateral * delta
+
+ if Input.is_action_pressed("player_up"):
+ velocity += SPEED * cam_vec_vertical * delta
+ elif Input.is_action_pressed("player_down"):
+ velocity += SPEED * -cam_vec_vertical * delta
+
+
+func _process(delta):
+ # move foward according to the camera's POV
+ var cam_vec_forward = $Camera.transform.basis.z
+ velocity += SPEED * -cam_vec_forward * delta
+
+ # get velocity changes player asks for
+ get_player_input(delta)
+
+func _physics_process(_delta):
+ velocity = move_and_slide(velocity, Vector3.UP)
-[gd_scene load_steps=8 format=2]
+[gd_scene load_steps=9 format=2]
[ext_resource path="res://model/arwing_wings.material" type="Material" id=1]
[ext_resource path="res://model/arwing_body.material" type="Material" id=2]
+[ext_resource path="res://player/player.gd" type="Script" id=3]
[sub_resource type="SpatialMaterial" id=1]
vertex_color_use_as_albedo = true
}
[sub_resource type="BoxShape" id=5]
-extents = Vector3( 3.72203, 0.878147, 2.99408 )
+extents = Vector3( 3.72203, 0.878147, 3.13957 )
[node name="arwing" type="KinematicBody"]
+script = ExtResource( 3 )
-[node name="body" type="MeshInstance" parent="."]
+[node name="mesh" type="Spatial" parent="."]
+transform = Transform( -1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 0, 0, 0 )
+
+[node name="body" type="MeshInstance" parent="mesh"]
mesh = SubResource( 2 )
material/0 = null
-[node name="thrust" type="MeshInstance" parent="."]
+[node name="thrust" type="MeshInstance" parent="mesh"]
mesh = SubResource( 3 )
material/0 = null
-[node name="wings" type="MeshInstance" parent="."]
+[node name="wings" type="MeshInstance" parent="mesh"]
mesh = SubResource( 4 )
material/0 = null
[node name="CollisionShape" type="CollisionShape" parent="."]
-transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.371765, 0.63321 )
+transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.371765, -0.470031 )
shape = SubResource( 5 )
+
+[node name="Camera" type="Camera" parent="."]
+transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 13.3084 )
[application]
config/name="star-foxy"
+run/main_scene="res://main.tscn"
config/icon="res://icon.png"
+[input]
+
+player_up={
+"deadzone": 0.5,
+"events": [ Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":1,"axis_value":-1.0,"script":null)
+ ]
+}
+player_down={
+"deadzone": 0.5,
+"events": [ Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":1,"axis_value":1.0,"script":null)
+ ]
+}
+player_left={
+"deadzone": 0.5,
+"events": [ Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":0,"axis_value":-1.0,"script":null)
+ ]
+}
+player_right={
+"deadzone": 0.5,
+"events": [ Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":0,"axis_value":1.0,"script":null)
+ ]
+}
+player_boost={
+"deadzone": 0.5,
+"events": [ Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":0,"pressure":0.0,"pressed":false,"script":null)
+ ]
+}
+player_fire={
+"deadzone": 0.5,
+"events": [ Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":7,"pressure":0.0,"pressed":false,"script":null)
+ ]
+}
+
[physics]
common/enable_pause_aware_picking=true