5 ms·
My raycast engine in Javascript needs a few more lines and works a little bit different, but gives also impressive results I think :) . http://simulationcorner
by s-macke 12y ago
My raycast engine in Javascript needs a few more lines and works a little bit different, but gives also impressive results I think :) .
http://simulationcorner.net/index.php?page=comanche http://simulationcorner.net/index.php?page=comanche
- hunterloftis 12y agoLove it! Thanks, just linked from the article.
- s-macke 12y agoHey thanks, that was fast.
- nppc 12y agoI really like how your code uses much less cpu than that of the article. whats the trick ?
- s-macke 12y agoDon't know. But here some possibilities: 1. No fullscreen 2. I update the screen only if a key is pressed.(No rain, that has to be rendered all the time) 3. I don't use any costly canvas functions. I render everything myself in a pixelbuffer. 4. Typed arrays
- hunterloftis 12y agoIt's #2. Redrawing at 60hz (or as close as the machine can come) is what hits the cpu so hard.
- s-macke 12y agoNo, I don't use requestAnimationFrame right now. I think when I wrote it, it was not supported by IE. But can't remember. I calculate as close as the machine can but with a window.setTimeout(Update, 0); in order to be responsive.
- pascalo 12y agoLove that you referenced Comanche ... my favorite helicopter game ever. Nice work on the JS side also!
- s-macke 12y agoThe graphics were impressive, but the gameplay never touched me. Comanche 3 was much better.
- philjackson 12y agoVery cool. Comanche was an excellent game too.