diff --git a/choco.lua b/choco.lua index e5a7673..e345a7b 100644 --- a/choco.lua +++ b/choco.lua @@ -1,9 +1,24 @@ ressources = { - fruits = 0, - money = 100, - jam = 0 + fruits = + { + quantity = 5, + sprite = 33, + x = 70 + }, + money = + { + quantity = 100, + sprite = 35, + x = 0 + }, + jam = + { + quantity = 0, + sprite = 34, + x = 100 + } } @@ -25,8 +40,16 @@ function _draw() map(0, 0, 0, 8, 64, 64) camera(0,0) draw_array(worldtiles) + draw_ressource_bar() end +function draw_ressource_bar() + rectfill(0, 0, 127, 7, 1) + for _,res in pairs(ressources) do + spr(res.sprite, res.x, 0) + print(res.quantity, res.x + 8, 1, 6) + end +end function updatecycle()