Skip to content

Instantly share code, notes, and snippets.

@default1200
Created July 14, 2023 13:50
Show Gist options
  • Save default1200/7983d64498f228e8de6cab193cd18e4c to your computer and use it in GitHub Desktop.
Save default1200/7983d64498f228e8de6cab193cd18e4c to your computer and use it in GitHub Desktop.
extends Node
export(int) var max_amount = 10
var current_hp : int = 1
onready var health_bar = $"../HealthBar"
func hp_changed(_value : int):
current_hp += _value
health_bar.value = current_hp
func _on_Area2D_body_entered(_body: Node) -> void:
print("lol")
hp_changed(3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment