Raycasting in JavaScript and React
github.com
github.com
https://arcade.makecode.com/14009-57824-16954-25349 https://forum.makecode.com/t/3d-raycasting-in-arcade/474
1. Read title 2. But why? 3. Click link 4. No <canvas> tag? Just html and react? How? 5. Open demo 6. Inspect elements 7. Oh... Gentle chuckle. But why? 8. Remembers Atwood's Law
You have written a lot of it in pure JS so I can see you're not using it as a crutch, but I am not familiar enough with React at it's edges to know why you would bring it in to the toolbelt here.
But you're right, vanilla JS would easily do the job.
Granted, with the speed of modern browsers and the relative simplicity of this rendering, one could probably literally wipe the DOM layer and rewrite it every frame without having any performance issues. But if the rendering became more complicated it’s conceivable that React’s virtual DOM stuff could noticeably improvement performance.
Don't tell that to a game dev
Also, I'm pretty sure there are many websites out there pushing around way more divs than this is.
There's lots of things a browser can do that would surprise a lot of developers.