Discord
Login
Community
DARK THEME

Camera Question

Hello! Im made a game about my school in germany i watched the tutorial for scrooling and camera this is my project https://microstudio.io/Sammy4141/lostintheschool2/6BHVSG7S all time when i walk out the map my character fills the screen 1000 times can you help me that i can make a barrier that the character not can walk out the map and the camera not works full

Set the project as public, we will be able to analyze the code. This makes it easier to diagnose the problem.

In order not to fall out of the map, you must check whether your character is inside the map before each move.

next.x = player.x + step.x
next.y = player.y + step.y
if (map.width > next.x ) then player.x = next.x end
if( map.height > next.y) then player.y = next.y end

Post a reply

Progress

Status

Preview
Cancel
Post
Validate your e-mail address to participate in the community