mirror of
https://github.com/vlang/v.git
synced 2025-09-18 03:46:36 -04:00
examples: make the tetris update rate, independent from the frame rate too
This commit is contained in:
parent
2860152e82
commit
aafbda4bc4
@ -140,7 +140,8 @@ fn (mut game Game) showfps() {
|
||||
}
|
||||
|
||||
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()
|
||||
}
|
||||
ws := gg.window_size()
|
||||
|
Loading…
x
Reference in New Issue
Block a user