Statsscript with speed

This commit is contained in:
Jan Schuffenhauer
2020-04-18 17:01:16 +02:00
parent dd870a1aa9
commit dbd852190b
3 changed files with 39 additions and 1 deletions

View File

@@ -11,6 +11,8 @@ export(int, 0, 500) var ROLL_SPEED := 150
export(int, 0, 500) var FRICTION := 200 # Speed at which the player deaccelarates
export(int, 0, 500) var ACCELERATION := 450
# Reference for the current player
onready var debug_label := $DebugLabel
onready var player_stats := $Stats
onready var animation_player := $AnimationPlayer
onready var animation_tree := $AnimationTree
onready var animation_state = animation_tree.get("parameters/playback")
@@ -23,7 +25,12 @@ enum moveState{
var movementState = moveState.MOVE
func _debug_update():
debug_label.text = str(player_stats.health) + "/" + str(player_stats.max_health) + " HP"
func _physics_process(delta):
_debug_update()
match movementState:
moveState.MOVE:
movement_move(delta)