From 4728b975e3c970e1d09a2ad93bc41226a6ef08a1 Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Thu, 11 Nov 2021 17:45:22 +0200 Subject: [PATCH] examples: use app.gg.quit() instead of exit(0) --- examples/2048/2048.v | 2 +- examples/flappylearning/game.v | 2 +- examples/tetris/tetris.v | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/2048/2048.v b/examples/2048/2048.v index d2372268ea..3cac25005a 100644 --- a/examples/2048/2048.v +++ b/examples/2048/2048.v @@ -788,7 +788,7 @@ fn (mut app App) on_key_down(key gg.KeyCode) { // these keys are independent from the game state: match key { .a { app.is_ai_mode = !app.is_ai_mode } - .escape { exit(0) } + .escape { app.gg.quit() } .n, .r { app.new_game() } .backspace { app.undo() } .enter { app.next_tile_format() } diff --git a/examples/flappylearning/game.v b/examples/flappylearning/game.v index 15cdc28ced..81f31d81f3 100644 --- a/examples/flappylearning/game.v +++ b/examples/flappylearning/game.v @@ -274,7 +274,7 @@ fn (mut app App) key_down(key gg.KeyCode) { // global keys match key { .escape { - exit(0) + app.gg.quit() } ._0 { app.timer_period_ms = 0 diff --git a/examples/tetris/tetris.v b/examples/tetris/tetris.v index 01589a3670..f860f02d9a 100644 --- a/examples/tetris/tetris.v +++ b/examples/tetris/tetris.v @@ -459,7 +459,7 @@ fn (mut game Game) key_down(key gg.KeyCode) { // global keys match key { .escape { - exit(0) + game.gg.quit() } .space { if game.state == .running {