mirror of
https://github.com/kristoferssolo/FuncIt.git
synced 2025-10-21 19:30:35 +00:00
19 lines
422 B
GDScript
19 lines
422 B
GDScript
extends Node2D
|
|
|
|
var player_following = null
|
|
var value = "" setget value_set
|
|
|
|
var distanceToPlayerOffset = -150
|
|
|
|
onready var health_bar = $health_bar
|
|
|
|
|
|
func _process(delta: float) -> void:
|
|
if player_following != null:
|
|
global_position = player_following.global_position + Vector2(0,distanceToPlayerOffset).rotated(player_following.rotation)
|
|
|
|
|
|
func value_set(new_text) -> void:
|
|
value = new_text
|
|
health_bar.value = value
|