Nice writeup! Building raycasting engines is fun and rewarding. You can get a lot of visual impact with very small and easy to understand code. I took a stab at it and ended up adding portals which I thought was really fun (<a href="https://github.com/gh123man/Portal-Raycaster">https://github.com/gh123man/Portal-Raycaster</a>).<p>I've been thinking about re-writing my raycasting engine in Rust but never really found the time - glad to see someone has done it and documented it so well!<p>If anyone else is interested in raycasting this page is also worth a read: <a href="https://lodev.org/cgtutor/raycasting.html" rel="nofollow">https://lodev.org/cgtutor/raycasting.html</a>
<i>1.7K is not the smallest you can make this program. You can get this to fit in even smaller sizes and I encourage you to try!</i><p>I think 128 bytes may be close to a lower limit, although for a different platform (MS-DOS): <a href="https://www.pouet.net/prod.php?which=63518" rel="nofollow">https://www.pouet.net/prod.php?which=63518</a>
The source code from this article is available at <a href="https://github.com/grantshandy/wasm4-raycaster">https://github.com/grantshandy/wasm4-raycaster</a>
Wow, I didn’t know that WebAssembly had a “square root” instruction (although it sounds like that’s required for the floating point standard, so probably shouldn’t have been such a surprise).
> My first experience with games like this (though I didn’t know at the time), was in middle school with games like zDoom on my calculator. zDoom<p>Sharing experiences. My first encounter and fascination for these kind of perpective effect was in the 90s demoscene.<p>I learned to program the magic behind "tunnel" effects by just spawning multiple non-concentric growing circles.