forked from unfa/liblast
Separated the player into it's own scene. Removed player script print.
parent
96c8607987
commit
71b36b5a56
24
Game.tscn
24
Game.tscn
|
@ -1,16 +1,12 @@
|
|||
[gd_scene load_steps=7 format=2]
|
||||
[gd_scene load_steps=5 format=2]
|
||||
|
||||
[ext_resource path="res://Player.gd" type="Script" id=1]
|
||||
[ext_resource path="res://Player.tscn" type="PackedScene" id=1]
|
||||
[ext_resource path="res://Game.gd" type="Script" id=2]
|
||||
|
||||
[sub_resource type="BoxShape" id=1]
|
||||
|
||||
[sub_resource type="CubeMesh" id=2]
|
||||
|
||||
[sub_resource type="CapsuleShape" id=3]
|
||||
|
||||
[sub_resource type="CapsuleMesh" id=4]
|
||||
|
||||
[node name="Game" type="Spatial"]
|
||||
script = ExtResource( 2 )
|
||||
|
||||
|
@ -39,18 +35,4 @@ operation = 2
|
|||
width = 12.0
|
||||
depth = 12.0
|
||||
|
||||
[node name="Player" type="KinematicBody" parent="."]
|
||||
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 12.2035, 0 )
|
||||
script = ExtResource( 1 )
|
||||
|
||||
[node name="Camera" type="Camera" parent="Player"]
|
||||
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.70316, -0.0651628 )
|
||||
|
||||
[node name="CollisionShape" type="CollisionShape" parent="Player"]
|
||||
transform = Transform( 1, 0, 0, 0, -1.62921e-07, 1, 0, -1, -1.62921e-07, 0, 0, 0 )
|
||||
shape = SubResource( 3 )
|
||||
|
||||
[node name="MeshInstance" type="MeshInstance" parent="Player"]
|
||||
transform = Transform( 1, 0, 0, 0, -1.62921e-07, 1, 0, -1, -1.62921e-07, 0, 0, 0 )
|
||||
mesh = SubResource( 4 )
|
||||
material/0 = null
|
||||
[node name="Player" parent="." instance=ExtResource( 1 )]
|
||||
|
|
|
@ -25,7 +25,7 @@ func walk():
|
|||
if Input.is_action_pressed("MoveLeft"):
|
||||
walkDirection.y -= 1
|
||||
|
||||
print("Player walkDirection: ", walkDirection)
|
||||
#print("Player walkDirection: ", walkDirection)
|
||||
|
||||
func motion(delta):
|
||||
self.move_and_slide(velocity * delta, Vector3.UP)
|
||||
|
|
|
@ -0,0 +1,23 @@
|
|||
[gd_scene load_steps=4 format=2]
|
||||
|
||||
[ext_resource path="res://Player.gd" type="Script" id=1]
|
||||
|
||||
[sub_resource type="CapsuleShape" id=3]
|
||||
|
||||
[sub_resource type="CapsuleMesh" id=4]
|
||||
|
||||
[node name="Player" type="KinematicBody"]
|
||||
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 12.2035, 0 )
|
||||
script = ExtResource( 1 )
|
||||
|
||||
[node name="Camera" type="Camera" parent="."]
|
||||
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.70316, -0.0651628 )
|
||||
|
||||
[node name="CollisionShape" type="CollisionShape" parent="."]
|
||||
transform = Transform( 1, 0, 0, 0, -1.62921e-07, 1, 0, -1, -1.62921e-07, 0, 0, 0 )
|
||||
shape = SubResource( 3 )
|
||||
|
||||
[node name="MeshInstance" type="MeshInstance" parent="."]
|
||||
transform = Transform( 1, 0, 0, 0, -1.62921e-07, 1, 0, -1, -1.62921e-07, 0, 0, 0 )
|
||||
mesh = SubResource( 4 )
|
||||
material/0 = null
|
Loading…
Reference in New Issue