From 1cb5af7935cb99a99e534c611ed3ae54f92af78e Mon Sep 17 00:00:00 2001 From: Canopteks <thomas.duhamel@protonmail.com> Date: Thu, 6 Feb 2020 11:51:48 +0100 Subject: [PATCH] physics sync --- client/scenes/entities/player/player.gd | 2 +- client/scenes/entities/player/player.tscn | 2 -- server/scenes/autoloads/gamestate.gd | 2 +- server/scenes/entities/player/player.gd | 2 ++ 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/client/scenes/entities/player/player.gd b/client/scenes/entities/player/player.gd index a20dd7b..9421270 100644 --- a/client/scenes/entities/player/player.gd +++ b/client/scenes/entities/player/player.gd @@ -25,4 +25,4 @@ func _ready(): player = $KinematicBody remote func getRemoteMovement(position): - player.move_and_slide(position, Vector3(0,1,0), 0.05, 4, deg2rad(MAX_SLOPE_ANGLE)) \ No newline at end of file + player.move_and_slide(position, Vector3(0,1,0), 0.05, 1, deg2rad(MAX_SLOPE_ANGLE)) \ No newline at end of file diff --git a/client/scenes/entities/player/player.tscn b/client/scenes/entities/player/player.tscn index 64a60bb..f8b4b8e 100644 --- a/client/scenes/entities/player/player.tscn +++ b/client/scenes/entities/player/player.tscn @@ -16,12 +16,10 @@ script = ExtResource( 1 ) [node name="Body_CollisionShape" type="CollisionShape" parent="KinematicBody"] transform = Transform( 1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, 0.585563, 0 ) shape = SubResource( 1 ) -disabled = true [node name="Feet_CollisionShape" type="CollisionShape" parent="KinematicBody"] transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.131137, 0 ) shape = SubResource( 2 ) -disabled = true [node name="Model" type="Spatial" parent="KinematicBody"] diff --git a/server/scenes/autoloads/gamestate.gd b/server/scenes/autoloads/gamestate.gd index 6716d83..3259d47 100644 --- a/server/scenes/autoloads/gamestate.gd +++ b/server/scenes/autoloads/gamestate.gd @@ -3,7 +3,7 @@ extends Node const GAMEPATH = "/root/game" const PORT = 10001 -const MAX_CLIENTS = 1 +const MAX_CLIENTS = 2 var players = {} diff --git a/server/scenes/entities/player/player.gd b/server/scenes/entities/player/player.gd index ad7fba6..f3bb8f5 100644 --- a/server/scenes/entities/player/player.gd +++ b/server/scenes/entities/player/player.gd @@ -14,6 +14,7 @@ const MAX_SPRINT_SPEED:float = 12.0 var isSprinting:bool = false const JUMP_SPEED:float = 16.0 +var isJumping:bool = false # TODO: unreal, try to understand that, genius const GRAVITY:float = -28.0 @@ -40,6 +41,7 @@ func getPlayerInputs(movementInput, sprintInput, jumpInput): motion.z = 0 isSprinting = sprintInput + isJumping = jumpInput if player.is_on_floor()||player.is_on_wall(): if jumpInput: -- GitLab