examples: make the tetris update rate, independent from the frame rate too

This commit is contained in:
Delyan Angelov 2025-03-09 09:05:02 +02:00
parent 2860152e82
commit aafbda4bc4
No known key found for this signature in database
GPG key ID: 66886C0F12D595ED

View file

@ -140,7 +140,8 @@ fn (mut game Game) showfps() {
} }
fn frame(mut game Game) { fn frame(mut game Game) {
if game.gg.frame & 15 == 0 { if game.gg.timer.elapsed().milliseconds() > 264 {
game.gg.timer.restart()
game.update_game_state() game.update_game_state()
} }
ws := gg.window_size() ws := gg.window_size()