• Welcome to Dark Bit Factory & Gravity.
 

[JS] Castle Wolfenstein - an homage to Wolfenstein 3D in 20 lines of JavaScript

Started by p01, February 02, 2008

Previous topic - Next topic

0 Members and 0 Guests are viewing this topic.

p01

It's a little quiet here. Let's post something.

Other there at the Ozone Asylum we have some 20 lines contests in JavaScript. It's a really fun exercise. The topic last month was about dynamics. I made some kind of hypnolgow ( always loved hypnoglow :P ) but the most interesting piece I delivered and am polishing now, though still in 20 lines is:


Castle Wolfenstein - an homage to Wolfenstein 3D in 20 lines of JavaScript


Before you ask : it doesn't work in IE. Works great in Opera 9.5 ( sorry don't have 9.2 at home ), and I'm investigating why FF3 chokes on it.

Tetra

It still supprises me that js can do this kinds of thing.

I really like hypnoglow its cool, and you done a pretty good job at wolfenstein :)

Isnt FF3 in beta atm? or did I miss something :D
Challenge Trophies Won:

p01

Thanks.

Yes Opera 9.5 and FireFox 3 are still in beta. FF3b2 came out ~6 weeks ago, Opera 9.5 build 9721 one month ago.

benny!

Kewl. Excellent work.

Never head about the <canvas> tag though ... nice! New
stuff to study 8-)
[ mycroBLOG - POUET :: whatever keeps us longing - for another breath of air - is getting rare ]

Challenge Trophies Won:

Shockwave

Shockwave ^ Codigos
Challenge Trophies Won:

rain_storm

I just downloaded and installed Opera just to see this in action and I must say that I am dumb-struck. This is very impressive for 20 lines of code. Very well done p01. Anyone else that hasnt seen this because they are using IE do yourself a favour and install Opera.

Challenge Trophies Won:

p01

that's a cool way to discover Opera.

Btw, there's a few new features since my first post:
  • exit door
  • generation of a new level : reset the player's coordinates and health and display an alert( "ENTER ROOM "+ M.level )
  • create an increasing number of attack dogs per level
  • fixed the markup generated. Very slight speed increase in FF3b2, but Opera 9.5 remains ~2x faster, with Safari 3b4 in between

The script is now 19 lines ( excluding the logs, to try and understand why FF3b2 is so slow ). I believe I can fit the player's game logic and a basic HUD in 20 lines.

Shockwave

I would not have said it was possible to squeeze Wolfenstein into so few lines of code.
We had a 20 line competition here some time ago, and some of the code was pretty obfurscated, nobody made a raycaster though!

There were some interesting things made however.. I think Optimus won that challenge with a lense mapped Xor thing :)
Shockwave ^ Codigos
Challenge Trophies Won:

Rbz

Challenge Trophies Won:

taj

P01 - that wolfenstein is awesome. Very very good programming.
Challenge Trophies Won:

p01

Thanks. It's cool to such feedback, esp. from some crazy optimizers.

Buckethead

Impressive, both in size and how you mastered the engine. >:D I'm very fan of this.
Keep on this pure work, it's always a pleasure to run your creations.  :stirrer:
Challenge Trophies Won: