doctorow at June 4th, 2014 13:01 — #1
oldtaku at June 4th, 2014 14:24 — #2
mathew at June 4th, 2014 14:37 — #3
More of a first person stabber, in fact.
howaboutthis at June 4th, 2014 14:44 — #4
Doom used binary space partitioning - a different beast. Blake Stone used raycasting, IIRC.
drew_millecchia at June 4th, 2014 15:18 — #5
But this is niiiiiice!
I wish more people could code as simply and straightforward as this.
oldtaku at June 4th, 2014 17:34 — #6
They're both raycasting - just throwing a light ray to see where it hits. But Wolfenstein does it with a simple grid layout. Doom uses BSP to divide the casting space up efficiently so you can get away from the grid.
See here for some details: http://bespin.org/~qz/pc-gpe/doom.txt
redesigned at June 4th, 2014 17:37 — #7
Wow, cool. I was half expecting each line to be 100 bajillion characters long, but that code is really clean, simple, and easy to read through and understand.
awjt at June 4th, 2014 17:42 — #8
Yes, I am aspiring to this level. He's awesome.
cowicide at June 4th, 2014 18:51 — #9
Just out of curiosity, what do you prefer instead?
jardine at June 4th, 2014 18:53 — #10
cowicide at June 4th, 2014 18:56 — #11
hubrissonic at June 4th, 2014 19:21 — #12
howaboutthis at June 4th, 2014 20:03 — #13
Oh geez, that's right. I used to know all that stuff.
I need to go dust off my Doom & Doom II mods.
ldobe at June 4th, 2014 21:00 — #14
I can't get the demo to have a decent framerate in Firefox... It only advances through the frames when my mouse is moving, and it's eating a vast amount of CPU.
journorati at June 4th, 2014 21:10 — #15
"Stop using Firefox then," said every frustratingly myopic coder ever.
ldobe at June 4th, 2014 21:37 — #16
Turns out it works in chrome.
samsam at June 5th, 2014 09:24 — #17
drew_millecchia at June 5th, 2014 09:41 — #18
What I hate most about js is the overuse of inline functions... within inline functions, within inline functions.. That's just crazy. And if you miss 1 comma everything goes boom.
This code, however, is a wonderful example of clean code that can be done in JS. Not hacky, tricky stuff that some were expecting.
It's not per se elegant, but this is what I would call 'crystallizing' your code, which is refining it down to exactly and only what it needs to be. No extra variables or functions that you may need later, or might be cool at some point.
Every single thing here is used and nothing wasted, no extraneous junk to muck things up. And that's why they can keep it short, and explain how the whole thing works beautifully.
And now is the time that other coders will grab it and muck it all up
awjt at June 5th, 2014 15:59 — #19
What is your definition of elegant? It's OK to pay something an unreserved compliment. That doesn't make you weak.
"Pleasingly ingenious and simple" is what I go by and this fits that definition pretty darn well.
cowicide at June 5th, 2014 16:37 — #20
I'm glad you put that aside, because that wasn't my intention. I just enjoy hearing about what people like to go along with what they don't like.
next page →