From 47af6a05318336ca9734409c135b9491c0d7c57e Mon Sep 17 00:00:00 2001 From: unfa Date: Sun, 14 Jun 2020 00:29:58 +0200 Subject: [PATCH] Started work on Player movement --- Player.gd | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 Player.gd diff --git a/Player.gd b/Player.gd new file mode 100644 index 0000000..67a73c5 --- /dev/null +++ b/Player.gd @@ -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