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

examples: fix dropping pieces with -autofree for tetris.v

This commit is contained in:
Delyan Angelov 2021-03-17 14:45:32 +02:00
parent e8df8bc8c3
commit c2b574384f
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED

View File

@ -321,7 +321,7 @@ fn (mut g Game) generate_tetro() {
// Get the right tetro from cache // Get the right tetro from cache
fn (mut g Game) get_tetro() { fn (mut g Game) get_tetro() {
idx := g.tetro_idx * tetro_size * tetro_size + g.rotation_idx * tetro_size idx := g.tetro_idx * tetro_size * tetro_size + g.rotation_idx * tetro_size
g.tetro = g.tetros_cache[idx..idx + tetro_size] g.tetro = g.tetros_cache[idx..idx + tetro_size].clone()
} }
// TODO mut // TODO mut