Hello everyone,
I'm not sure why I'm having so much trouble figuring this out... I'll keep this simple.
I'm testing out some idle game mechanics, where something gets incremented every second. Because it's an idle game with no graphics, I just have a script that is not attached to a node. Stuff gets incremented in the class, then the GUI updates with the updated value.
I have been trying to create a Timer that calls the increment() function every second, but it doesn't work. How can I use a timer in a script that is not attached to a node? Is there any way to do this? Here is what I have been trying:
timer = Timer.new()
timer.one_shot = false
timer.wait_time = 1
timer.connect("timeout", self, "_on_Timer_timeout")
timer.start()
it doesn't seem to connect properly, it never makes it to the "_on_Timer_timeout" function.