1
0
Fork 0
This repository has been archived on 2022-10-04. You can view files and clone it, but cannot push or open issues or pull requests.
godot-thunderk-basics/random_tool.gd

13 lines
206 B
GDScript

tool
# Tools for randomization
static func pick(array):
""" Pick a random item in an array
"""
if array.size():
# TODO more uniform method
return array[randi() % array.size()]
else:
return null