Merge with Unfa

remotes/1711838515240372319/tmp_refs/heads/godot4-port
Jan 2020-06-14 00:32:57 +02:00
commit 79b6821ec1
2 changed files with 34 additions and 3 deletions

View File

@ -40,6 +40,10 @@ 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 )
@ -49,6 +53,3 @@ shape = SubResource( 3 )
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="Camera" type="Camera" parent="."]
transform = Transform( 1, 0, 0, 0, 0.750734, 0.660605, 0, -0.660605, 0.750734, 0, 17.0162, 15.1792 )

30
Player.gd Normal file
View File

@ -0,0 +1,30 @@
extends KinematicBody
const GRAVITY = 9.8
var velocity = Vector3.ZERO
# Declare member variables here. Examples:
# var a = 2
# var b = "text"
func gravity(delta):
self.velocity.y -= GRAVITY * delta
func motion(delta):
self.move_and_slide(velocity, Vector3.UP)
#rpc("move_and_slide", velocity, Vector3.UP)
func _physics_process(delta):
gravity(delta)
motion(delta)
# Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
#func _process(delta):
# pass