Author Topic: [JS] Castle Wolfenstein - an homage to Wolfenstein 3D in 20 lines of JavaScript  (Read 8382 times)

0 Members and 2 Guests are viewing this topic.

Offline p01

  • Atari ST
  • ***
  • Posts: 158
  • Karma: 51
    • View Profile
    • www.p01.org
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.
« Last Edit: February 02, 2008 by p01 »

Offline Tetra

  • DBF Aficionado
  • ******
  • Posts: 2532
  • Karma: 83
  • Pirate Monkey!
    • View Profile
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:

Offline p01

  • Atari ST
  • ***
  • Posts: 158
  • Karma: 51
    • View Profile
    • www.p01.org
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.

Offline benny!

  • Senior Member
  • DBF Aficionado
  • ********
  • Posts: 4384
  • Karma: 228
  • in this place forever!
    • View Profile
    • bennyschuetz.com - mycroBlog
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:

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17414
  • Karma: 498
  • evil/good
    • View Profile
    • My Homepage
Wolfenstein in 20 lines of Javascript?!?!
crumbs!
Shockwave ^ Codigos
Challenge Trophies Won:

Offline rain_storm

  • Here comes the Rain
  • DBF Aficionado
  • ******
  • Posts: 3088
  • Karma: 182
  • Rain never hurt nobody
    • View Profile
    • org_100h
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:

Offline p01

  • Atari ST
  • ***
  • Posts: 158
  • Karma: 51
    • View Profile
    • www.p01.org
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.

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17414
  • Karma: 498
  • evil/good
    • View Profile
    • My Homepage
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:

Offline Rbz

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 2757
  • Karma: 493
    • View Profile
    • https://www.rbraz.com/
Very very cool, hypnoglow effect rocks   :goodpost:
Challenge Trophies Won:

Offline taj

  • Bytes hurt
  • DBF Aficionado
  • ******
  • Posts: 4810
  • Karma: 189
  • Scene there, done that.
    • View Profile
P01 - that wolfenstein is awesome. Very very good programming.
Challenge Trophies Won:

Offline p01

  • Atari ST
  • ***
  • Posts: 158
  • Karma: 51
    • View Profile
    • www.p01.org
Thanks. It's cool to such feedback, esp. from some crazy optimizers.

Offline Buckethead

  • C= 64
  • **
  • Posts: 58
  • Karma: 30
    • View Profile
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: