48 lines
658 B
Lua
48 lines
658 B
Lua
function _init()
|
|
world_init()
|
|
playercontroler_init()
|
|
end
|
|
|
|
function _update()
|
|
world_update()
|
|
playercontroler_update()
|
|
end
|
|
|
|
function _draw()
|
|
cls(0)
|
|
map(0, 0, 0, 8, 64, 64)
|
|
camera(0,0)
|
|
draw_ressource_bar()
|
|
world_draw()
|
|
playercontroler_draw()
|
|
end
|
|
|
|
ressources =
|
|
{
|
|
fruit =
|
|
{
|
|
quantity = 55,
|
|
sprite = 33,
|
|
x = 70
|
|
},
|
|
money =
|
|
{
|
|
quantity = 100,
|
|
sprite = 35,
|
|
x = 0
|
|
},
|
|
jam =
|
|
{
|
|
quantity = 100,
|
|
sprite = 34,
|
|
x = 100
|
|
}
|
|
}
|
|
|
|
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 |