1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

examples: show the tetris ghost by default

This commit is contained in:
Delyan Angelov 2021-06-24 11:59:18 +03:00
parent 96adfc9d5b
commit 5a308005d5
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED

View File

@ -115,7 +115,7 @@ mut:
// gg context for drawing
gg &gg.Context = voidptr(0)
font_loaded bool
show_ghost bool
show_ghost bool = true
// frame/time counters:
frame int
frame_old int
@ -226,7 +226,8 @@ fn (g &Game) draw_ghost() {
pos_y := g.move_ghost()
for i in 0 .. tetro_size {
tetro := g.tetro[i]
g.draw_block_color(pos_y + tetro.y, g.pos_x + tetro.x, gx.gray)
g.draw_block_color(pos_y + tetro.y, g.pos_x + tetro.x, gx.rgba(125, 125, 225,
40))
}
}
}