From abfadcee49f10cd7e75433e2febfdb6835dba568 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Sun, 1 Oct 2023 01:59:28 +0200 Subject: [PATCH] Do not use clampi to keep code simple --- spawner/spawner.gd | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/spawner/spawner.gd b/spawner/spawner.gd index 672d27b..f188599 100644 --- a/spawner/spawner.gd +++ b/spawner/spawner.gd @@ -11,7 +11,9 @@ var buffer: int = 0 func spawn(): - buffer = clampi(buffer + 1, 0, buffer_cap) + buffer += 1 + if buffer > buffer_cap: + buffer = buffer_cap func _physics_process(_delta):