Before I do anything serious I want to be able to load and move a sprite and map accordingly which I've learned with game maker over the years and learning true tile-based stuff with love.
The image below shows the issue, it's not an issue but the camera should not show it in an actual game.
I'm basically just using the default camera movement that was with the a.t.l., while it's nice it should not go outside the map it loads and shows the black background which annoys me as not every map is going to cover an area with trees to block the player from moving the camera which eventually would show the black background.
so I'm wondering if anyone has an idea of stopping the camera movement if the edge/end of the map was reached depending on which direction the character was moving in, doesn't matter if it's up,down,left,right or diagonal panning it should stop at the edge.
Just for reference this is the code from the demo.
Code: Select all
if love.keyboard.isDown("up") then ty = ty + 250*dt end
if love.keyboard.isDown("down") then ty = ty - 250*dt end
if love.keyboard.isDown("left") then tx = tx + 250*dt end
if love.keyboard.isDown("right") then tx = tx - 250*dt end
if map_edge_reached_x then stop_camera = true end
if map_edge_reached_y then stop_camera = true end
yea bad example but would be something similar that would be used so the camera can't pan outside the map you load.
Getting maps to work is really my only issue with Love I've been able to do at least what I've tested that I could with Game Maker so far and that makes me happy.