I followed the Callacades tutorial on Love2d Basics (https://youtube.com/playlist?list=PLqPL ... _h_JGLgGg2)
I added some coins to collect and each disappear as collected.
At the end of the game I want to zoom out to show the whole map.
Map is created in Tiled with 2 Layers
gameMap is loaded with STI
Windfield for the world
Camera to track the player
love.draw displays portion of map with
Code: Select all
function love.draw()
cam:attach()
if gameOver then
gameMap:resize(screen.w, screen.h)
gameMap:drawLayer(gameMap.layers["Ground"])
gameMap:drawLayer(gameMap.layers["Trees"])
else
gameMap:drawLayer(gameMap.layers["Ground"])
gameMap:drawLayer(gameMap.layers["Trees"])
--coin.animation:draw(coin.spriteSheet, coin.x, coin.y, nil, .7, nil, 16, 13)
for i, coin in pairs(coins)
do
coin.animation:draw(coin.spriteSheet, coin.x, coin.y, nil, .7, nil, 16, 13)
end
player.anim:draw(player.spriteSheet, player.x, player.y, nil, 6, nil, 6, 9)
world:draw()
end
cam:detach()
end
TIA