Datasets:
Download FlyBy.gd from jtatman/godot_rl_FlyBy: direct link, hf CLI and curl.
- Browser
- Download file 402 Bytes
-
https://huggingface.co/datasets/jtatman/godot_rl_FlyBy/resolve/main/FlyBy.gd
- Command line
-
hf download hf://datasets/jtatman/godot_rl_FlyBy/FlyBy.gd
-
curl -L -o FlyBy.gd https://huggingface.co/datasets/jtatman/godot_rl_FlyBy/resolve/main/FlyBy.gd
402 Bytes
| extends Node3D | |
| var goals = null | |
| func _ready(): | |
| goals = $Goals.get_children() | |
| func get_next_goal(current_goal): | |
| if current_goal == null: | |
| return goals[0] | |
| var index = null | |
| for i in len(goals): | |
| if goals[i] == current_goal: | |
| index = (i + 1) % len(goals) | |
| break | |
| return goals[index] | |
| func get_last_goal(): | |
| return goals[-1] | |