mirror of
https://github.com/vlang/v.git
synced 2025-09-13 14:32:26 +03:00
examples: make the tetris update rate, independent from the frame rate too
This commit is contained in:
parent
2860152e82
commit
aafbda4bc4
1 changed files with 2 additions and 1 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue