mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
examples: use app.gg.quit() instead of exit(0)
This commit is contained in:
parent
9cb378bb6b
commit
4728b975e3
@ -788,7 +788,7 @@ fn (mut app App) on_key_down(key gg.KeyCode) {
|
|||||||
// these keys are independent from the game state:
|
// these keys are independent from the game state:
|
||||||
match key {
|
match key {
|
||||||
.a { app.is_ai_mode = !app.is_ai_mode }
|
.a { app.is_ai_mode = !app.is_ai_mode }
|
||||||
.escape { exit(0) }
|
.escape { app.gg.quit() }
|
||||||
.n, .r { app.new_game() }
|
.n, .r { app.new_game() }
|
||||||
.backspace { app.undo() }
|
.backspace { app.undo() }
|
||||||
.enter { app.next_tile_format() }
|
.enter { app.next_tile_format() }
|
||||||
|
@ -274,7 +274,7 @@ fn (mut app App) key_down(key gg.KeyCode) {
|
|||||||
// global keys
|
// global keys
|
||||||
match key {
|
match key {
|
||||||
.escape {
|
.escape {
|
||||||
exit(0)
|
app.gg.quit()
|
||||||
}
|
}
|
||||||
._0 {
|
._0 {
|
||||||
app.timer_period_ms = 0
|
app.timer_period_ms = 0
|
||||||
|
@ -459,7 +459,7 @@ fn (mut game Game) key_down(key gg.KeyCode) {
|
|||||||
// global keys
|
// global keys
|
||||||
match key {
|
match key {
|
||||||
.escape {
|
.escape {
|
||||||
exit(0)
|
game.gg.quit()
|
||||||
}
|
}
|
||||||
.space {
|
.space {
|
||||||
if game.state == .running {
|
if game.state == .running {
|
||||||
|
Loading…
Reference in New Issue
Block a user