Repos / shark / a060156e5c
commit a060156e5c16e737c6aeb6e5344362b09ef54f97
Author: Nhân <hi@imnhan.com>
Date:   Sat Sep 30 14:33:12 2023 +0700

    set max 60 ticks per second
    
    Makes sure animation doesn't run too fast on high-refresh-rate displays.

diff --git a/main.go b/main.go
index 0c354f6..c23191b 100644
--- a/main.go
+++ b/main.go
@@ -118,6 +118,7 @@ func main() {
 
 	DurationTillHungry = time.Duration(secondsUntilHungryFlag) * 1_000_000_000
 
+	ebiten.SetTPS(60)
 	ebiten.SetWindowPosition(xFlag, yFlag)
 	WindowWidth = SPRITE_X * sizeFlag
 	WindowHeight = SPRITE_Y * sizeFlag