doctorow — 2014-06-04T13:01:40-04:00 — #1
oldtaku — 2014-06-04T14:24:46-04:00 — #2
mathew — 2014-06-04T14:37:08-04:00 — #3
More of a first person stabber, in fact.
howaboutthis — 2014-06-04T14:44:30-04:00 — #4
Doom used binary space partitioning - a different beast. Blake Stone used raycasting, IIRC.
drew_millecchia — 2014-06-04T15:18:01-04:00 — #5
But this is niiiiiice!
I wish more people could code as simply and straightforward as this.
oldtaku — 2014-06-04T17:34:58-04:00 — #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 — 2014-06-04T17:37:34-04:00 — #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 — 2014-06-04T17:42:25-04:00 — #8
Yes, I am aspiring to this level. He's awesome.
cowicide — 2014-06-04T18:51:56-04:00 — #9
Just out of curiosity, what do you prefer instead?
jardine — 2014-06-04T18:53:25-04:00 — #10
cowicide — 2014-06-04T18:56:07-04:00 — #11
hubrissonic — 2014-06-04T19:21:34-04:00 — #12
howaboutthis — 2014-06-04T20:03:44-04:00 — #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 — 2014-06-04T21:00:33-04: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 — 2014-06-04T21:10:21-04:00 — #15
"Stop using Firefox then," said every frustratingly myopic coder ever.
ldobe — 2014-06-04T21:37:13-04:00 — #16
Turns out it works in chrome.
samsam — 2014-06-05T09:24:34-04:00 — #17
drew_millecchia — 2014-06-05T09:41:51-04:00 — #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 — 2014-06-05T15:59:19-04:00 — #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 — 2014-06-05T16:37:33-04:00 — #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 →