Tweak Player parameters

This commit is contained in:
Fabien Freling 2018-07-19 15:37:10 +02:00
parent a0f3a249ab
commit 331c273302

View file

@ -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.