diff --git a/Player.gd b/Player.gd index 5255edf..8d6f60c 100644 --- a/Player.gd +++ b/Player.gd @@ -1,11 +1,11 @@ extends KinematicBody -const norm_gravity = -80 +const norm_gravity = -100 var velocity = Vector3() const MAX_SLOPE_ANGLE = 60 func _ready(): - print("player init") + pass func _physics_process(delta): # Keyboard input @@ -23,15 +23,17 @@ func _physics_process(delta): direction.y = 0 direction = direction.normalized() - # Speep - var speed = 2.0 + # Speed + var speed = 3.0 direction *= speed # Gravity direction.y = norm_gravity * delta # Collision - velocity = move_and_slide(direction, Vector3(0,1,0), 0.05, 4, deg2rad(MAX_SLOPE_ANGLE)) + var floor_normal = Vector3(0, 1, 0) + velocity = move_and_slide(direction, floor_normal, 0.05, 4, deg2rad(MAX_SLOPE_ANGLE)) + func _process(delta): # Called every frame. Delta is time since last frame.