2025-09-23 13:36:19 +02:00
|
|
|
class_name Global
|
|
|
|
|
|
2025-10-15 16:00:47 +02:00
|
|
|
# Returns the next damage instance (and increases by 1)
|
2025-09-23 13:36:19 +02:00
|
|
|
static var next_dmg_id : int = 0 :
|
|
|
|
|
get:
|
|
|
|
|
next_dmg_id += 1
|
|
|
|
|
return next_dmg_id
|
2025-10-05 15:01:51 +02:00
|
|
|
|
2025-10-15 16:00:47 +02:00
|
|
|
# Entrywise modulo
|
2025-10-21 16:06:16 +02:00
|
|
|
static func vec_mod(vec : Vector2, modulus : float, only_x = false, only_y = false):
|
|
|
|
|
return Vector2(
|
|
|
|
|
fposmod(vec.x, modulus) if not only_y else vec.x,
|
|
|
|
|
fposmod(vec.y, modulus) if not only_x else vec.y)
|