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

gg: renaming drawing functions (#12913)

This commit is contained in:
Benjamin Stigsen
2021-12-23 12:31:25 +01:00
committed by GitHub
parent ad1ef6a9e2
commit 546c388b02
15 changed files with 145 additions and 55 deletions

View File

@ -157,16 +157,16 @@ fn on_frame(mut app App) {
}
// drawing snake
for pos in app.snake {
app.gg.draw_rect(tile_size * pos.x, tile_size * pos.y + top_height, tile_size,
app.gg.draw_rect_filled(tile_size * pos.x, tile_size * pos.y + top_height, tile_size,
tile_size, gx.blue)
}
// drawing food
app.gg.draw_rect(tile_size * app.food.x, tile_size * app.food.y + top_height, tile_size,
tile_size, gx.red)
app.gg.draw_rect_filled(tile_size * app.food.x, tile_size * app.food.y + top_height,
tile_size, tile_size, gx.red)
// drawing top
app.gg.draw_rect(0, 0, canvas_size, top_height, gx.black)
app.gg.draw_rect_filled(0, 0, canvas_size, top_height, gx.black)
app.gg.draw_text(150, top_height / 2, 'Score: $app.score', gx.TextCfg{
color: gx.white
align: .center