Download health_system.gd from edbeeching/godot_rl_FPS: direct link, hf CLI and curl.
- Browser
- Download file 315 Bytes
-
https://huggingface.co/datasets/edbeeching/godot_rl_FPS/resolve/main/health_system.gd
- Command line
-
hf download hf://datasets/edbeeching/godot_rl_FPS/health_system.gd
-
curl -L -o health_system.gd https://huggingface.co/datasets/edbeeching/godot_rl_FPS/resolve/main/health_system.gd
315 Bytes
| extends Node | |
| var starting_hp = 30 | |
| var hp = starting_hp | |
| var player : Player = null | |
| func init(p): | |
| player = p | |
| func reset(): | |
| hp = starting_hp | |
| func take_damage(damage): | |
| hp -= damage | |
| #prints("take damage", hp, damage, hp <= 0) | |
| if hp <= 0: | |
| die() | |
| func die(): | |
| player.died() | |
| #print("player died") | |