Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(+1)
You have to update your scroll bounds! That's the reason I think, if the camera doesn't render those tiles they don't collide

mmmm, thanks for the comment! I'll see if I can find something related to bounds.

What do you mean by "if the camera doesn't render those tiles"? I'm seeing the tiles, but maybe the camera is not aware of them?

(+1)

The camera size is for example 640x480 but if your tilemap is 1024x760 only the area cover from (0,0) to (640,480) wil be collidable. You have to set FlxG.camera.setBoundsRect(0,0,tilemap.width,tilemap.height, true), the boolean value advice to the camera to take into account the non render piece of tilemap (the area outside the current camera viewport).

(+1)

Yes! you're totally correct! thanks a lot man :D

Here's the line

FlxG.camera.setBounds(0, 0, tileMapWidth, tileMapHeight, true);

where tileMapWidth and tileMapHeight are in pixels (tilesize in pixel * number of tiles).

Yes! That's the way, sorry for not posting the code before but i wasn't at my computer, nice to know you got it right!