diff --git a/assets/foresttrees.png b/assets/foresttrees.png index 7913068..4c11812 100644 Binary files a/assets/foresttrees.png and b/assets/foresttrees.png differ diff --git a/main.lua b/main.lua index 9eb15e7..50d4264 100644 --- a/main.lua +++ b/main.lua @@ -15,6 +15,8 @@ local add_entity_from_map = function(object) end function lutro.load() + bg1 = lutro.graphics.newImage(lutro.path .. "assets/forestbackground.png") + bg2 = lutro.graphics.newImage(lutro.path .. "assets/foresttrees.png") map = tiled_load(lutro.path .. "assets/pagode.json") tiled_load_objects(map, add_entity_from_map) table.insert(entities, newNinja()) @@ -31,6 +33,14 @@ end function lutro.draw() lutro.graphics.clear(0xff000000) + + for i=0, 1 do + lutro.graphics.draw(bg1.data, + i*bg1.width + lutro.camera_x/6, 0, bg1.width, bg1.height) + lutro.graphics.draw(bg2.data, + i*bg2.width + lutro.camera_x/3, 0, bg2.width, bg2.height) + end + tiled_draw_layer(map.layers[1]) for i=1, #entities do if entities[i].draw then