Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Inside the while loop that does the actual raycast, there's an if statement that checks if the ray has gone out of bounds and stops it. It'll look like:

if mget(x,y)>0 or x<0 or x>31 or y<0 or y>31 then

-- stop the ray

You can change those numbers to change the size of the visible map. This demo uses pico-8's map, so it's limited to 128x64. If you need something larger than that, you could use a table instead, which can be whatever size you want.

Just be aware, when the map gets too big it may start to lag because the rays are checking every intersection across the whole map. You can solve this with fancy optimization, or just avoid making wide open spaces or very long tunnels.

Hope this helps!