Raycast In tldraw
For one of my tldraw projects I’ve been working on, I need to be able to know if something is under a shape. As someone who dabbles in game development, naturally I wanted to reach for a raycast so I could send out a ray and see if any shapes intersected with it. I looked in the tldraw docs and it doesn’t seem like functionality that exists in the base API, which makes sense because tldraw is not a game engine. So I figure I create it myself, how hard could it be? Let’s find out.
Tldraw - Can It Run Doom (Shapes)?
Ok so we did this before at Tldraw - Can It Run Doom? but we cheated a bit, we just compiled for WebAssembly and placed the canvas Emscripten created on the tldraw canvas.
But now let’s do it for real. Can tldraw run Doom, but with tldraw shapes to render the game’s pixels.
So we’re going to have the same setup as the last post. We’re starting with the changes we made to SDL-Doom to get it to compile and Emscripten installed. I’ll only be going over the things that are different between that post and this one.
Learning Language Through Code Comments
I’ve been trying, mostly unsuccessfully, to learn another language. I tried Duolingo, even with a subscription, and felt it was too gamified. I didn’t feel like I retained much of anything. In reality, I’m sure I probably retained more than I realize but I can’t really recall any particular lesson. I didn’t feel like much of the information stuck with me, other than a few basic words. Near the end I would only log in to get on the leaderboard.
Tldraw - Can It Run Doom (Canvas)?
Well yes, yes it can. I’m not even sure why I explored this but I did so I might as well write about it.
Note: Check out the next post, running tldoom with shapes instead of a canvas
After some brief research, it looked like compiling SDLDoom to WebAssembly was going to be the best way to approach this. If you’re unfamiliar with SDL, like I was at the beginning, it’s a library for low level access to audio, graphics, and input and it makes Doom easier to compile and run on modern operating systems.
Tldraw Rider - Sled the Slopes Of Your Infinite Canvas
I work with tldraw for my day job. One day, when I was tasked with a myriad of small bug fixes, I was looking at the tldraw canvas and I was reminded of a game I used to play back in school, Line Rider. The premise of the game is that there’s an entity on a sled and you have to draw lines for them to sled on. So I thought, “Hey, tldraw is perfect for this” which is how this became my weekend project this weekend.