Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(+2)

Great reference! I managed to get it working after a bit of tinkering. I ended up making my own simple raycasting funcion which assumes we are looking for an intersection on the z = 0 plane.  Anyone reading this is welcome to steal it:

function simple_raycasting( dx, dy, dz, ox, oy, oz ) {
    var _t = oz/-dz;
    return [ox + dx*_t, oy + dy*_t];
}

Hello, I'm new to game development and I'd like to know how to implement your function. I didn't understand which values to pass 🥲. (dx, dy, dz)