How do I go about my game loop?

I’m trying to replicate the game loop of the game Tower of Hell. My initial idea about the code is this…

while true do
	for time = 8, 0, -1 do
		print(time)
		wait(1)
		
		if time == 0 then
			print("resetting...")
		end
	end
end

What are your thoughts about this?

I recommend removing the

if time == 0 then
   print("resetting...")
end

and just move the print(“resetting…”) outside the for loop
The resetting… will print after the loop is done

1 Like