3 layers paralax

This commit is contained in:
Jean-André Santoni 2017-06-28 17:53:42 +02:00
parent aeb5f11cec
commit a05ba0aea0
6 changed files with 6 additions and 4 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.5 KiB

View File

@ -55,8 +55,9 @@ function lutro.load()
gold = 0
hp = 3
lutro.graphics.setBackgroundColor(0, 0, 0)
bg1 = lutro.graphics.newImage("assets/forestbackground.png")
bg2 = lutro.graphics.newImage("assets/foresttrees.png")
bg0 = lutro.graphics.newImage("assets/forestbackground0.png")
bg1 = lutro.graphics.newImage("assets/forestbackground1.png")
bg2 = lutro.graphics.newImage("assets/forestbackground2.png")
--font = lutro.graphics.newImageFont("assets/font.png",
-- " abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.,!?-+/")
barfont = lutro.graphics.newImageFont("assets/barfont.png",
@ -124,8 +125,9 @@ function lutro.draw()
lutro.graphics.clear()
for i=0, 4 do
lutro.graphics.draw(bg1, i*bg1:getWidth() + camera_x / 6, 0)
--lutro.graphics.draw(bg2, i*bg2:getWidth() + camera_x / 3, 0)
lutro.graphics.draw(bg2, i*bg2:getWidth() + camera_x / 8, 0)
lutro.graphics.draw(bg1, i*bg1:getWidth() + camera_x / 4, 0)
lutro.graphics.draw(bg0, i*bg0:getWidth() + camera_x / 2, 0)
end
lutro.graphics.push()