├── .gitignore ├── art ├── bj.png ├── hudbg.png ├── title.png ├── attack.png ├── gamebg.png ├── hudkeys.png ├── paused.png ├── getpsyched.png ├── hudnumbers.png ├── hudweapons.png ├── menuitems.png ├── menulight.png ├── skillfaces.png ├── control_keys.png ├── intermission.png ├── menubg_levels.png ├── menubg_main.png ├── menubg_skill.png ├── menubg_sound.png ├── menuselector.png ├── confirm_newgame.png ├── intermissionbj.png ├── menubg_control.png ├── menubg_episodes.png ├── intermissionfont.png ├── menubg_customize.png ├── menuitems_episodes.png ├── menuitems_levels.png ├── sprites │ ├── 64 │ │ ├── 002_053.png │ │ ├── 054_102.png │ │ ├── 103_141.png │ │ ├── 142_190.png │ │ ├── 191_241.png │ │ ├── 242_291.png │ │ ├── 292_299.png │ │ ├── 300_310.png │ │ ├── 311_324.png │ │ ├── 325_337.png │ │ ├── 338_363.png │ │ ├── 364_373.png │ │ ├── 374_388.png │ │ ├── 408_418.png │ │ ├── 419_430.png │ │ └── 431_438.png │ └── 128 │ │ ├── 002_053.png │ │ ├── 054_102.png │ │ ├── 103_141.png │ │ ├── 142_190.png │ │ ├── 191_241.png │ │ ├── 242_291.png │ │ ├── 292_299.png │ │ ├── 300_310.png │ │ ├── 311_324.png │ │ ├── 325_337.png │ │ ├── 338_363.png │ │ ├── 364_373.png │ │ ├── 374_388.png │ │ ├── 408_418.png │ │ ├── 419_430.png │ │ └── 431_438.png ├── intermission_secret.png ├── intermission_victory.png ├── text-screens │ ├── help-1.png │ ├── help-10.png │ ├── help-11.png │ ├── help-2.png │ ├── help-3.png │ ├── help-4.png │ ├── help-5.png │ ├── help-6.png │ ├── help-7.png │ ├── help-8.png │ ├── help-9.png │ ├── victory1-1.png │ ├── victory1-2.png │ ├── victory2-1.png │ ├── victory2-2.png │ └── victory3-1.png ├── walls-shaded │ ├── 64 │ │ ├── w_1.png │ │ ├── w_11.png │ │ ├── w_13.png │ │ ├── w_15.png │ │ ├── w_17.png │ │ ├── w_19.png │ │ ├── w_21.png │ │ ├── w_23.png │ │ ├── w_25.png │ │ ├── w_27.png │ │ ├── w_29.png │ │ ├── w_3.png │ │ ├── w_31.png │ │ ├── w_33.png │ │ ├── w_35.png │ │ ├── w_37.png │ │ ├── w_39.png │ │ ├── w_41.png │ │ ├── w_43.png │ │ ├── w_45.png │ │ ├── w_47.png │ │ ├── w_49.png │ │ ├── w_5.png │ │ ├── w_51.png │ │ ├── w_53.png │ │ ├── w_55.png │ │ ├── w_57.png │ │ ├── w_59.png │ │ ├── w_61.png │ │ ├── w_63.png │ │ ├── w_65.png │ │ ├── w_67.png │ │ ├── w_69.png │ │ ├── w_7.png │ │ ├── w_71.png │ │ ├── w_73.png │ │ ├── w_75.png │ │ ├── w_77.png │ │ ├── w_79.png │ │ ├── w_81.png │ │ ├── w_83.png │ │ ├── w_85.png │ │ ├── w_87.png │ │ ├── w_89.png │ │ ├── w_9.png │ │ ├── w_91.png │ │ ├── w_93.png │ │ ├── w_95.png │ │ ├── w_97.png │ │ ├── w_99.png │ │ ├── w_101.png │ │ ├── w_103.png │ │ ├── w_105.png │ │ ├── w_107.png │ │ ├── w_109.png │ │ ├── w_3.png.1 │ │ └── walls.png │ └── 128 │ │ ├── w_1.png │ │ ├── w_3.png │ │ ├── w_5.png │ │ ├── w_7.png │ │ ├── w_9.png │ │ ├── w_101.png │ │ ├── w_103.png │ │ ├── w_105.png │ │ ├── w_107.png │ │ ├── w_109.png │ │ ├── w_11.png │ │ ├── w_13.png │ │ ├── w_15.png │ │ ├── w_17.png │ │ ├── w_19.png │ │ ├── w_21.png │ │ ├── w_23.png │ │ ├── w_25.png │ │ ├── w_27.png │ │ ├── w_29.png │ │ ├── w_31.png │ │ ├── w_33.png │ │ ├── w_35.png │ │ ├── w_37.png │ │ ├── w_39.png │ │ ├── w_41.png │ │ ├── w_43.png │ │ ├── w_45.png │ │ ├── w_47.png │ │ ├── w_49.png │ │ ├── w_51.png │ │ ├── w_53.png │ │ ├── w_55.png │ │ ├── w_57.png │ │ ├── w_59.png │ │ ├── w_61.png │ │ ├── w_63.png │ │ ├── w_65.png │ │ ├── w_67.png │ │ ├── w_69.png │ │ ├── w_71.png │ │ ├── w_73.png │ │ ├── w_75.png │ │ ├── w_77.png │ │ ├── w_79.png │ │ ├── w_81.png │ │ ├── w_83.png │ │ ├── w_85.png │ │ ├── w_87.png │ │ ├── w_89.png │ │ ├── w_91.png │ │ ├── w_93.png │ │ ├── w_95.png │ │ ├── w_97.png │ │ └── w_99.png └── intermission_gameover.png ├── favicon.png ├── sfx ├── 001.ogg ├── 002.ogg ├── 007.ogg ├── 010.ogg ├── 011.ogg ├── 012.ogg ├── 013.ogg ├── 015.ogg ├── 017.ogg ├── 019.ogg ├── 022.ogg ├── 024.ogg ├── 025.ogg ├── 026.ogg ├── 027.ogg ├── 034.ogg ├── 035.ogg ├── 037.ogg ├── 040.ogg ├── 044.ogg ├── 046.ogg ├── 049.ogg ├── 052.ogg ├── 054.ogg ├── 061.ogg ├── 065.ogg ├── 069.ogg ├── 071.ogg ├── 074.ogg ├── 076.ogg ├── 078.ogg ├── 080.ogg ├── 082.ogg ├── 084.ogg ├── 086.ogg ├── 088.ogg ├── 091.ogg ├── 096.ogg ├── 102.ogg ├── 103.ogg ├── 105.ogg ├── 107.ogg ├── 109.ogg ├── 112.ogg ├── 115.ogg └── 119.ogg ├── lsfx ├── 001.ogg ├── 003.ogg ├── 005.ogg ├── 008.ogg ├── 009.ogg ├── 012.ogg ├── 023.ogg ├── 028.ogg ├── 030.ogg ├── 031.ogg ├── 032.ogg ├── 033.ogg ├── 034.ogg ├── 035.ogg ├── 036.ogg ├── 037.ogg ├── 038.ogg ├── 039.ogg ├── 040.ogg ├── 044.ogg ├── 045.ogg ├── 061.ogg ├── 062.ogg ├── 064.ogg ├── 069.ogg ├── 076.ogg ├── 078.ogg ├── 080.ogg ├── 085.ogg └── 086.ogg ├── music ├── POW.ogg ├── CORNER.ogg ├── PACMAN.ogg ├── ROSTER.ogg ├── SALUTE.ogg ├── DUNGEON.ogg ├── ENDLEVEL.ogg ├── FUNKYOU.ogg ├── GETTHEM.ogg ├── GOINGAFT.ogg ├── HEADACHE.ogg ├── HITLWLTZ.ogg ├── INTROCW3.ogg ├── NAZI_NOR.ogg ├── NAZI_OMI.ogg ├── NAZI_RAP.ogg ├── PREGNANT.ogg ├── SEARCHN.ogg ├── SUSPENSE.ogg ├── TWELFTH.ogg ├── ULTIMATE.ogg ├── URAHERO.ogg ├── VICMARCH.ogg ├── VICTORS.ogg ├── WARMARCH.ogg ├── WONDERIN.ogg └── ZEROHOUR.ogg ├── js ├── requestAnimFrame.js ├── random.js ├── load.js ├── angle.js ├── wolf.js ├── areas.js ├── pushwall.js ├── episodes.js ├── weapon.js ├── file.js ├── sound.js ├── raycaster.js ├── input.js ├── powerups.js ├── math.js ├── modernizr.custom.js ├── renderer.js └── doors.js ├── README.md ├── download_all_music.py └── index.html /.gitignore: -------------------------------------------------------------------------------- 1 | *.DS_Store 2 | *.pyc 3 | -------------------------------------------------------------------------------- /art/bj.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/bj.png -------------------------------------------------------------------------------- /favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/favicon.png -------------------------------------------------------------------------------- /sfx/001.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/sfx/001.ogg -------------------------------------------------------------------------------- /sfx/002.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/sfx/002.ogg -------------------------------------------------------------------------------- /sfx/007.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/sfx/007.ogg -------------------------------------------------------------------------------- /sfx/010.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/sfx/010.ogg -------------------------------------------------------------------------------- /sfx/011.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/sfx/011.ogg -------------------------------------------------------------------------------- /sfx/012.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/sfx/012.ogg -------------------------------------------------------------------------------- /sfx/013.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/sfx/013.ogg -------------------------------------------------------------------------------- /sfx/015.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/sfx/015.ogg -------------------------------------------------------------------------------- /sfx/017.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/sfx/017.ogg -------------------------------------------------------------------------------- /sfx/019.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/sfx/019.ogg -------------------------------------------------------------------------------- /sfx/022.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/sfx/022.ogg -------------------------------------------------------------------------------- /sfx/024.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/sfx/024.ogg -------------------------------------------------------------------------------- /sfx/025.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/sfx/025.ogg -------------------------------------------------------------------------------- /sfx/026.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/sfx/026.ogg -------------------------------------------------------------------------------- /sfx/027.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/sfx/027.ogg -------------------------------------------------------------------------------- /sfx/034.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/sfx/034.ogg -------------------------------------------------------------------------------- /sfx/035.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/sfx/035.ogg -------------------------------------------------------------------------------- /sfx/037.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/sfx/037.ogg -------------------------------------------------------------------------------- /sfx/040.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/sfx/040.ogg -------------------------------------------------------------------------------- /sfx/044.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/sfx/044.ogg -------------------------------------------------------------------------------- /sfx/046.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/sfx/046.ogg -------------------------------------------------------------------------------- /sfx/049.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/sfx/049.ogg -------------------------------------------------------------------------------- /sfx/052.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/sfx/052.ogg -------------------------------------------------------------------------------- /sfx/054.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/sfx/054.ogg -------------------------------------------------------------------------------- /sfx/061.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/sfx/061.ogg -------------------------------------------------------------------------------- /sfx/065.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/sfx/065.ogg -------------------------------------------------------------------------------- /sfx/069.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/sfx/069.ogg -------------------------------------------------------------------------------- /sfx/071.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/sfx/071.ogg -------------------------------------------------------------------------------- /sfx/074.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/sfx/074.ogg -------------------------------------------------------------------------------- /sfx/076.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/sfx/076.ogg -------------------------------------------------------------------------------- /sfx/078.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/sfx/078.ogg -------------------------------------------------------------------------------- /sfx/080.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/sfx/080.ogg -------------------------------------------------------------------------------- /sfx/082.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/sfx/082.ogg -------------------------------------------------------------------------------- /sfx/084.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/sfx/084.ogg -------------------------------------------------------------------------------- /sfx/086.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/sfx/086.ogg -------------------------------------------------------------------------------- /sfx/088.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/sfx/088.ogg -------------------------------------------------------------------------------- /sfx/091.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/sfx/091.ogg -------------------------------------------------------------------------------- /sfx/096.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/sfx/096.ogg -------------------------------------------------------------------------------- /sfx/102.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/sfx/102.ogg -------------------------------------------------------------------------------- /sfx/103.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/sfx/103.ogg -------------------------------------------------------------------------------- /sfx/105.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/sfx/105.ogg -------------------------------------------------------------------------------- /sfx/107.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/sfx/107.ogg -------------------------------------------------------------------------------- /sfx/109.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/sfx/109.ogg -------------------------------------------------------------------------------- /sfx/112.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/sfx/112.ogg -------------------------------------------------------------------------------- /sfx/115.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/sfx/115.ogg -------------------------------------------------------------------------------- /sfx/119.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/sfx/119.ogg -------------------------------------------------------------------------------- /art/hudbg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/hudbg.png -------------------------------------------------------------------------------- /art/title.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/title.png -------------------------------------------------------------------------------- /lsfx/001.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/lsfx/001.ogg -------------------------------------------------------------------------------- /lsfx/003.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/lsfx/003.ogg -------------------------------------------------------------------------------- /lsfx/005.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/lsfx/005.ogg -------------------------------------------------------------------------------- /lsfx/008.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/lsfx/008.ogg -------------------------------------------------------------------------------- /lsfx/009.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/lsfx/009.ogg -------------------------------------------------------------------------------- /lsfx/012.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/lsfx/012.ogg -------------------------------------------------------------------------------- /lsfx/023.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/lsfx/023.ogg -------------------------------------------------------------------------------- /lsfx/028.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/lsfx/028.ogg -------------------------------------------------------------------------------- /lsfx/030.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/lsfx/030.ogg -------------------------------------------------------------------------------- /lsfx/031.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/lsfx/031.ogg -------------------------------------------------------------------------------- /lsfx/032.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/lsfx/032.ogg -------------------------------------------------------------------------------- /lsfx/033.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/lsfx/033.ogg -------------------------------------------------------------------------------- /lsfx/034.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/lsfx/034.ogg -------------------------------------------------------------------------------- /lsfx/035.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/lsfx/035.ogg -------------------------------------------------------------------------------- /lsfx/036.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/lsfx/036.ogg -------------------------------------------------------------------------------- /lsfx/037.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/lsfx/037.ogg -------------------------------------------------------------------------------- /lsfx/038.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/lsfx/038.ogg -------------------------------------------------------------------------------- /lsfx/039.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/lsfx/039.ogg -------------------------------------------------------------------------------- /lsfx/040.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/lsfx/040.ogg -------------------------------------------------------------------------------- /lsfx/044.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/lsfx/044.ogg -------------------------------------------------------------------------------- /lsfx/045.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/lsfx/045.ogg -------------------------------------------------------------------------------- /lsfx/061.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/lsfx/061.ogg -------------------------------------------------------------------------------- /lsfx/062.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/lsfx/062.ogg -------------------------------------------------------------------------------- /lsfx/064.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/lsfx/064.ogg -------------------------------------------------------------------------------- /lsfx/069.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/lsfx/069.ogg -------------------------------------------------------------------------------- /lsfx/076.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/lsfx/076.ogg -------------------------------------------------------------------------------- /lsfx/078.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/lsfx/078.ogg -------------------------------------------------------------------------------- /lsfx/080.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/lsfx/080.ogg -------------------------------------------------------------------------------- /lsfx/085.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/lsfx/085.ogg -------------------------------------------------------------------------------- /lsfx/086.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/lsfx/086.ogg -------------------------------------------------------------------------------- /music/POW.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/music/POW.ogg -------------------------------------------------------------------------------- /art/attack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/attack.png -------------------------------------------------------------------------------- /art/gamebg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/gamebg.png -------------------------------------------------------------------------------- /art/hudkeys.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/hudkeys.png -------------------------------------------------------------------------------- /art/paused.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/paused.png -------------------------------------------------------------------------------- /music/CORNER.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/music/CORNER.ogg -------------------------------------------------------------------------------- /music/PACMAN.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/music/PACMAN.ogg -------------------------------------------------------------------------------- /music/ROSTER.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/music/ROSTER.ogg -------------------------------------------------------------------------------- /music/SALUTE.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/music/SALUTE.ogg -------------------------------------------------------------------------------- /art/getpsyched.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/getpsyched.png -------------------------------------------------------------------------------- /art/hudnumbers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/hudnumbers.png -------------------------------------------------------------------------------- /art/hudweapons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/hudweapons.png -------------------------------------------------------------------------------- /art/menuitems.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/menuitems.png -------------------------------------------------------------------------------- /art/menulight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/menulight.png -------------------------------------------------------------------------------- /art/skillfaces.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/skillfaces.png -------------------------------------------------------------------------------- /music/DUNGEON.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/music/DUNGEON.ogg -------------------------------------------------------------------------------- /music/ENDLEVEL.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/music/ENDLEVEL.ogg -------------------------------------------------------------------------------- /music/FUNKYOU.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/music/FUNKYOU.ogg -------------------------------------------------------------------------------- /music/GETTHEM.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/music/GETTHEM.ogg -------------------------------------------------------------------------------- /music/GOINGAFT.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/music/GOINGAFT.ogg -------------------------------------------------------------------------------- /music/HEADACHE.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/music/HEADACHE.ogg -------------------------------------------------------------------------------- /music/HITLWLTZ.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/music/HITLWLTZ.ogg -------------------------------------------------------------------------------- /music/INTROCW3.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/music/INTROCW3.ogg -------------------------------------------------------------------------------- /music/NAZI_NOR.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/music/NAZI_NOR.ogg -------------------------------------------------------------------------------- /music/NAZI_OMI.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/music/NAZI_OMI.ogg -------------------------------------------------------------------------------- /music/NAZI_RAP.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/music/NAZI_RAP.ogg -------------------------------------------------------------------------------- /music/PREGNANT.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/music/PREGNANT.ogg -------------------------------------------------------------------------------- /music/SEARCHN.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/music/SEARCHN.ogg -------------------------------------------------------------------------------- /music/SUSPENSE.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/music/SUSPENSE.ogg -------------------------------------------------------------------------------- /music/TWELFTH.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/music/TWELFTH.ogg -------------------------------------------------------------------------------- /music/ULTIMATE.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/music/ULTIMATE.ogg -------------------------------------------------------------------------------- /music/URAHERO.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/music/URAHERO.ogg -------------------------------------------------------------------------------- /music/VICMARCH.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/music/VICMARCH.ogg -------------------------------------------------------------------------------- /music/VICTORS.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/music/VICTORS.ogg -------------------------------------------------------------------------------- /music/WARMARCH.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/music/WARMARCH.ogg -------------------------------------------------------------------------------- /music/WONDERIN.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/music/WONDERIN.ogg -------------------------------------------------------------------------------- /music/ZEROHOUR.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/music/ZEROHOUR.ogg -------------------------------------------------------------------------------- /art/control_keys.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/control_keys.png -------------------------------------------------------------------------------- /art/intermission.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/intermission.png -------------------------------------------------------------------------------- /art/menubg_levels.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/menubg_levels.png -------------------------------------------------------------------------------- /art/menubg_main.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/menubg_main.png -------------------------------------------------------------------------------- /art/menubg_skill.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/menubg_skill.png -------------------------------------------------------------------------------- /art/menubg_sound.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/menubg_sound.png -------------------------------------------------------------------------------- /art/menuselector.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/menuselector.png -------------------------------------------------------------------------------- /art/confirm_newgame.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/confirm_newgame.png -------------------------------------------------------------------------------- /art/intermissionbj.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/intermissionbj.png -------------------------------------------------------------------------------- /art/menubg_control.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/menubg_control.png -------------------------------------------------------------------------------- /art/menubg_episodes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/menubg_episodes.png -------------------------------------------------------------------------------- /js/requestAnimFrame.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/js/requestAnimFrame.js -------------------------------------------------------------------------------- /art/intermissionfont.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/intermissionfont.png -------------------------------------------------------------------------------- /art/menubg_customize.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/menubg_customize.png -------------------------------------------------------------------------------- /art/menuitems_episodes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/menuitems_episodes.png -------------------------------------------------------------------------------- /art/menuitems_levels.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/menuitems_levels.png -------------------------------------------------------------------------------- /art/sprites/64/002_053.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/sprites/64/002_053.png -------------------------------------------------------------------------------- /art/sprites/64/054_102.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/sprites/64/054_102.png -------------------------------------------------------------------------------- /art/sprites/64/103_141.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/sprites/64/103_141.png -------------------------------------------------------------------------------- /art/sprites/64/142_190.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/sprites/64/142_190.png -------------------------------------------------------------------------------- /art/sprites/64/191_241.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/sprites/64/191_241.png -------------------------------------------------------------------------------- /art/sprites/64/242_291.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/sprites/64/242_291.png -------------------------------------------------------------------------------- /art/sprites/64/292_299.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/sprites/64/292_299.png -------------------------------------------------------------------------------- /art/sprites/64/300_310.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/sprites/64/300_310.png -------------------------------------------------------------------------------- /art/sprites/64/311_324.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/sprites/64/311_324.png -------------------------------------------------------------------------------- /art/sprites/64/325_337.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/sprites/64/325_337.png -------------------------------------------------------------------------------- /art/sprites/64/338_363.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/sprites/64/338_363.png -------------------------------------------------------------------------------- /art/sprites/64/364_373.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/sprites/64/364_373.png -------------------------------------------------------------------------------- /art/sprites/64/374_388.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/sprites/64/374_388.png -------------------------------------------------------------------------------- /art/sprites/64/408_418.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/sprites/64/408_418.png -------------------------------------------------------------------------------- /art/sprites/64/419_430.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/sprites/64/419_430.png -------------------------------------------------------------------------------- /art/sprites/64/431_438.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/sprites/64/431_438.png -------------------------------------------------------------------------------- /art/intermission_secret.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/intermission_secret.png -------------------------------------------------------------------------------- /art/intermission_victory.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/intermission_victory.png -------------------------------------------------------------------------------- /art/sprites/128/002_053.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/sprites/128/002_053.png -------------------------------------------------------------------------------- /art/sprites/128/054_102.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/sprites/128/054_102.png -------------------------------------------------------------------------------- /art/sprites/128/103_141.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/sprites/128/103_141.png -------------------------------------------------------------------------------- /art/sprites/128/142_190.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/sprites/128/142_190.png -------------------------------------------------------------------------------- /art/sprites/128/191_241.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/sprites/128/191_241.png -------------------------------------------------------------------------------- /art/sprites/128/242_291.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/sprites/128/242_291.png -------------------------------------------------------------------------------- /art/sprites/128/292_299.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/sprites/128/292_299.png -------------------------------------------------------------------------------- /art/sprites/128/300_310.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/sprites/128/300_310.png -------------------------------------------------------------------------------- /art/sprites/128/311_324.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/sprites/128/311_324.png -------------------------------------------------------------------------------- /art/sprites/128/325_337.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/sprites/128/325_337.png -------------------------------------------------------------------------------- /art/sprites/128/338_363.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/sprites/128/338_363.png -------------------------------------------------------------------------------- /art/sprites/128/364_373.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/sprites/128/364_373.png -------------------------------------------------------------------------------- /art/sprites/128/374_388.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/sprites/128/374_388.png -------------------------------------------------------------------------------- /art/sprites/128/408_418.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/sprites/128/408_418.png -------------------------------------------------------------------------------- /art/sprites/128/419_430.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/sprites/128/419_430.png -------------------------------------------------------------------------------- /art/sprites/128/431_438.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/sprites/128/431_438.png -------------------------------------------------------------------------------- /art/text-screens/help-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/text-screens/help-1.png -------------------------------------------------------------------------------- /art/text-screens/help-10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/text-screens/help-10.png -------------------------------------------------------------------------------- /art/text-screens/help-11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/text-screens/help-11.png -------------------------------------------------------------------------------- /art/text-screens/help-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/text-screens/help-2.png -------------------------------------------------------------------------------- /art/text-screens/help-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/text-screens/help-3.png -------------------------------------------------------------------------------- /art/text-screens/help-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/text-screens/help-4.png -------------------------------------------------------------------------------- /art/text-screens/help-5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/text-screens/help-5.png -------------------------------------------------------------------------------- /art/text-screens/help-6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/text-screens/help-6.png -------------------------------------------------------------------------------- /art/text-screens/help-7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/text-screens/help-7.png -------------------------------------------------------------------------------- /art/text-screens/help-8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/text-screens/help-8.png -------------------------------------------------------------------------------- /art/text-screens/help-9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/text-screens/help-9.png -------------------------------------------------------------------------------- /art/walls-shaded/128/w_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/walls-shaded/128/w_1.png -------------------------------------------------------------------------------- /art/walls-shaded/128/w_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/walls-shaded/128/w_3.png -------------------------------------------------------------------------------- /art/walls-shaded/128/w_5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/walls-shaded/128/w_5.png -------------------------------------------------------------------------------- /art/walls-shaded/128/w_7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/walls-shaded/128/w_7.png -------------------------------------------------------------------------------- /art/walls-shaded/128/w_9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/walls-shaded/128/w_9.png -------------------------------------------------------------------------------- /art/walls-shaded/64/w_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/walls-shaded/64/w_1.png -------------------------------------------------------------------------------- /art/walls-shaded/64/w_11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/walls-shaded/64/w_11.png -------------------------------------------------------------------------------- /art/walls-shaded/64/w_13.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/walls-shaded/64/w_13.png -------------------------------------------------------------------------------- /art/walls-shaded/64/w_15.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/walls-shaded/64/w_15.png -------------------------------------------------------------------------------- /art/walls-shaded/64/w_17.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/walls-shaded/64/w_17.png -------------------------------------------------------------------------------- /art/walls-shaded/64/w_19.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/walls-shaded/64/w_19.png -------------------------------------------------------------------------------- /art/walls-shaded/64/w_21.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/walls-shaded/64/w_21.png -------------------------------------------------------------------------------- /art/walls-shaded/64/w_23.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/walls-shaded/64/w_23.png -------------------------------------------------------------------------------- /art/walls-shaded/64/w_25.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/walls-shaded/64/w_25.png -------------------------------------------------------------------------------- /art/walls-shaded/64/w_27.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/walls-shaded/64/w_27.png -------------------------------------------------------------------------------- /art/walls-shaded/64/w_29.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/walls-shaded/64/w_29.png -------------------------------------------------------------------------------- /art/walls-shaded/64/w_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/walls-shaded/64/w_3.png -------------------------------------------------------------------------------- /art/walls-shaded/64/w_31.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/walls-shaded/64/w_31.png -------------------------------------------------------------------------------- /art/walls-shaded/64/w_33.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/walls-shaded/64/w_33.png -------------------------------------------------------------------------------- /art/walls-shaded/64/w_35.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/walls-shaded/64/w_35.png -------------------------------------------------------------------------------- /art/walls-shaded/64/w_37.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/walls-shaded/64/w_37.png -------------------------------------------------------------------------------- /art/walls-shaded/64/w_39.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/walls-shaded/64/w_39.png -------------------------------------------------------------------------------- /art/walls-shaded/64/w_41.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/walls-shaded/64/w_41.png -------------------------------------------------------------------------------- /art/walls-shaded/64/w_43.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/walls-shaded/64/w_43.png -------------------------------------------------------------------------------- /art/walls-shaded/64/w_45.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/walls-shaded/64/w_45.png -------------------------------------------------------------------------------- /art/walls-shaded/64/w_47.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/walls-shaded/64/w_47.png -------------------------------------------------------------------------------- /art/walls-shaded/64/w_49.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/walls-shaded/64/w_49.png -------------------------------------------------------------------------------- /art/walls-shaded/64/w_5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/walls-shaded/64/w_5.png -------------------------------------------------------------------------------- /art/walls-shaded/64/w_51.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/walls-shaded/64/w_51.png -------------------------------------------------------------------------------- /art/walls-shaded/64/w_53.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/walls-shaded/64/w_53.png -------------------------------------------------------------------------------- /art/walls-shaded/64/w_55.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/walls-shaded/64/w_55.png -------------------------------------------------------------------------------- /art/walls-shaded/64/w_57.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/walls-shaded/64/w_57.png -------------------------------------------------------------------------------- /art/walls-shaded/64/w_59.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/walls-shaded/64/w_59.png -------------------------------------------------------------------------------- /art/walls-shaded/64/w_61.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/walls-shaded/64/w_61.png -------------------------------------------------------------------------------- /art/walls-shaded/64/w_63.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/walls-shaded/64/w_63.png -------------------------------------------------------------------------------- /art/walls-shaded/64/w_65.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/walls-shaded/64/w_65.png -------------------------------------------------------------------------------- /art/walls-shaded/64/w_67.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/walls-shaded/64/w_67.png -------------------------------------------------------------------------------- /art/walls-shaded/64/w_69.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/walls-shaded/64/w_69.png -------------------------------------------------------------------------------- /art/walls-shaded/64/w_7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/walls-shaded/64/w_7.png -------------------------------------------------------------------------------- /art/walls-shaded/64/w_71.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/walls-shaded/64/w_71.png -------------------------------------------------------------------------------- /art/walls-shaded/64/w_73.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/walls-shaded/64/w_73.png -------------------------------------------------------------------------------- /art/walls-shaded/64/w_75.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/walls-shaded/64/w_75.png -------------------------------------------------------------------------------- /art/walls-shaded/64/w_77.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/walls-shaded/64/w_77.png -------------------------------------------------------------------------------- /art/walls-shaded/64/w_79.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/walls-shaded/64/w_79.png -------------------------------------------------------------------------------- /art/walls-shaded/64/w_81.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/walls-shaded/64/w_81.png -------------------------------------------------------------------------------- /art/walls-shaded/64/w_83.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/walls-shaded/64/w_83.png -------------------------------------------------------------------------------- /art/walls-shaded/64/w_85.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/walls-shaded/64/w_85.png -------------------------------------------------------------------------------- /art/walls-shaded/64/w_87.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/walls-shaded/64/w_87.png -------------------------------------------------------------------------------- /art/walls-shaded/64/w_89.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/walls-shaded/64/w_89.png -------------------------------------------------------------------------------- /art/walls-shaded/64/w_9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/walls-shaded/64/w_9.png -------------------------------------------------------------------------------- /art/walls-shaded/64/w_91.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/walls-shaded/64/w_91.png -------------------------------------------------------------------------------- /art/walls-shaded/64/w_93.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/walls-shaded/64/w_93.png -------------------------------------------------------------------------------- /art/walls-shaded/64/w_95.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/walls-shaded/64/w_95.png -------------------------------------------------------------------------------- /art/walls-shaded/64/w_97.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/walls-shaded/64/w_97.png -------------------------------------------------------------------------------- /art/walls-shaded/64/w_99.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/walls-shaded/64/w_99.png -------------------------------------------------------------------------------- /art/intermission_gameover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/intermission_gameover.png -------------------------------------------------------------------------------- /art/text-screens/victory1-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/text-screens/victory1-1.png -------------------------------------------------------------------------------- /art/text-screens/victory1-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/text-screens/victory1-2.png -------------------------------------------------------------------------------- /art/text-screens/victory2-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/text-screens/victory2-1.png -------------------------------------------------------------------------------- /art/text-screens/victory2-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/text-screens/victory2-2.png -------------------------------------------------------------------------------- /art/text-screens/victory3-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/text-screens/victory3-1.png -------------------------------------------------------------------------------- /art/walls-shaded/128/w_101.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/walls-shaded/128/w_101.png -------------------------------------------------------------------------------- /art/walls-shaded/128/w_103.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/walls-shaded/128/w_103.png -------------------------------------------------------------------------------- /art/walls-shaded/128/w_105.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/walls-shaded/128/w_105.png -------------------------------------------------------------------------------- /art/walls-shaded/128/w_107.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/walls-shaded/128/w_107.png -------------------------------------------------------------------------------- /art/walls-shaded/128/w_109.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/walls-shaded/128/w_109.png -------------------------------------------------------------------------------- /art/walls-shaded/128/w_11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/walls-shaded/128/w_11.png -------------------------------------------------------------------------------- /art/walls-shaded/128/w_13.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/walls-shaded/128/w_13.png -------------------------------------------------------------------------------- /art/walls-shaded/128/w_15.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/walls-shaded/128/w_15.png -------------------------------------------------------------------------------- /art/walls-shaded/128/w_17.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/walls-shaded/128/w_17.png -------------------------------------------------------------------------------- /art/walls-shaded/128/w_19.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/walls-shaded/128/w_19.png -------------------------------------------------------------------------------- /art/walls-shaded/128/w_21.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/walls-shaded/128/w_21.png -------------------------------------------------------------------------------- /art/walls-shaded/128/w_23.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/walls-shaded/128/w_23.png -------------------------------------------------------------------------------- /art/walls-shaded/128/w_25.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/walls-shaded/128/w_25.png -------------------------------------------------------------------------------- /art/walls-shaded/128/w_27.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/walls-shaded/128/w_27.png -------------------------------------------------------------------------------- /art/walls-shaded/128/w_29.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/walls-shaded/128/w_29.png -------------------------------------------------------------------------------- /art/walls-shaded/128/w_31.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/walls-shaded/128/w_31.png -------------------------------------------------------------------------------- /art/walls-shaded/128/w_33.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/walls-shaded/128/w_33.png -------------------------------------------------------------------------------- /art/walls-shaded/128/w_35.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/walls-shaded/128/w_35.png -------------------------------------------------------------------------------- /art/walls-shaded/128/w_37.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/walls-shaded/128/w_37.png -------------------------------------------------------------------------------- /art/walls-shaded/128/w_39.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/walls-shaded/128/w_39.png -------------------------------------------------------------------------------- /art/walls-shaded/128/w_41.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/walls-shaded/128/w_41.png -------------------------------------------------------------------------------- /art/walls-shaded/128/w_43.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/walls-shaded/128/w_43.png -------------------------------------------------------------------------------- /art/walls-shaded/128/w_45.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/walls-shaded/128/w_45.png -------------------------------------------------------------------------------- /art/walls-shaded/128/w_47.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/walls-shaded/128/w_47.png -------------------------------------------------------------------------------- /art/walls-shaded/128/w_49.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/walls-shaded/128/w_49.png -------------------------------------------------------------------------------- /art/walls-shaded/128/w_51.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/walls-shaded/128/w_51.png -------------------------------------------------------------------------------- /art/walls-shaded/128/w_53.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/walls-shaded/128/w_53.png -------------------------------------------------------------------------------- /art/walls-shaded/128/w_55.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/walls-shaded/128/w_55.png -------------------------------------------------------------------------------- /art/walls-shaded/128/w_57.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/walls-shaded/128/w_57.png -------------------------------------------------------------------------------- /art/walls-shaded/128/w_59.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/walls-shaded/128/w_59.png -------------------------------------------------------------------------------- /art/walls-shaded/128/w_61.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/walls-shaded/128/w_61.png -------------------------------------------------------------------------------- /art/walls-shaded/128/w_63.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/walls-shaded/128/w_63.png -------------------------------------------------------------------------------- /art/walls-shaded/128/w_65.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/walls-shaded/128/w_65.png -------------------------------------------------------------------------------- /art/walls-shaded/128/w_67.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/walls-shaded/128/w_67.png -------------------------------------------------------------------------------- /art/walls-shaded/128/w_69.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/walls-shaded/128/w_69.png -------------------------------------------------------------------------------- /art/walls-shaded/128/w_71.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/walls-shaded/128/w_71.png -------------------------------------------------------------------------------- /art/walls-shaded/128/w_73.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/walls-shaded/128/w_73.png -------------------------------------------------------------------------------- /art/walls-shaded/128/w_75.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/walls-shaded/128/w_75.png -------------------------------------------------------------------------------- /art/walls-shaded/128/w_77.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/walls-shaded/128/w_77.png -------------------------------------------------------------------------------- /art/walls-shaded/128/w_79.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/walls-shaded/128/w_79.png -------------------------------------------------------------------------------- /art/walls-shaded/128/w_81.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/walls-shaded/128/w_81.png -------------------------------------------------------------------------------- /art/walls-shaded/128/w_83.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/walls-shaded/128/w_83.png -------------------------------------------------------------------------------- /art/walls-shaded/128/w_85.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/walls-shaded/128/w_85.png -------------------------------------------------------------------------------- /art/walls-shaded/128/w_87.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/walls-shaded/128/w_87.png -------------------------------------------------------------------------------- /art/walls-shaded/128/w_89.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/walls-shaded/128/w_89.png -------------------------------------------------------------------------------- /art/walls-shaded/128/w_91.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/walls-shaded/128/w_91.png -------------------------------------------------------------------------------- /art/walls-shaded/128/w_93.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/walls-shaded/128/w_93.png -------------------------------------------------------------------------------- /art/walls-shaded/128/w_95.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/walls-shaded/128/w_95.png -------------------------------------------------------------------------------- /art/walls-shaded/128/w_97.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/walls-shaded/128/w_97.png -------------------------------------------------------------------------------- /art/walls-shaded/128/w_99.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/walls-shaded/128/w_99.png -------------------------------------------------------------------------------- /art/walls-shaded/64/w_101.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/walls-shaded/64/w_101.png -------------------------------------------------------------------------------- /art/walls-shaded/64/w_103.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/walls-shaded/64/w_103.png -------------------------------------------------------------------------------- /art/walls-shaded/64/w_105.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/walls-shaded/64/w_105.png -------------------------------------------------------------------------------- /art/walls-shaded/64/w_107.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/walls-shaded/64/w_107.png -------------------------------------------------------------------------------- /art/walls-shaded/64/w_109.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/walls-shaded/64/w_109.png -------------------------------------------------------------------------------- /art/walls-shaded/64/w_3.png.1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/walls-shaded/64/w_3.png.1 -------------------------------------------------------------------------------- /art/walls-shaded/64/walls.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loadx/html5-wolfenstein3D/HEAD/art/walls-shaded/64/walls.png -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | HTML5 Wolfenstein 3D 2 | ====================== 3 | 4 | This is a clone of what was released for wolfenstein 3D's 20th birthday with minor modifications to remove hard coded paths. 5 | 6 | All property is copyright Bethesda and id software. 7 | [http://wolfenstein.bethsoft.com/](http://wolfenstein.bethsoft.com) 8 | 9 | You can play this in your browser using: 10 | https://loadx.github.io/html5-wolfenstein3D 11 | 12 | _p.s If anyone at Bethesda or id software has objections to this being hosted on github please let me know and I will remove it but I assume because Wolfenstein 3D is open source then you won't mind :)_ 13 | -------------------------------------------------------------------------------- /download_all_music.py: -------------------------------------------------------------------------------- 1 | import os 2 | import urllib2 3 | import sys 4 | 5 | # Place this in the root folder 6 | paths = ['lsfx/', 'sfx/', 'music/'] 7 | site_url = 'http://zmi-cdnstatic.s3.amazonaws.com/wolfenstein.bethsoft.com' 8 | 9 | for path in paths: 10 | if not os.path.exists(path): 11 | current_path = path[:-1] 12 | print "Couldn't find the %s folder. Check you are running this from the root folder or the %s folder is not missing." % (current_path, current_path) 13 | else: 14 | for infile in os.listdir(path): 15 | if os.path.splitext(infile)[1] == '.ogg': 16 | mp3_file_name = path + infile[:-4] + '.mp3' 17 | remote = urllib2.urlopen('%s/%s' % (site_url, mp3_file_name)) 18 | try: 19 | print 'Downloading %s' % mp3_file_name 20 | open(mp3_file_name, 'wb').write(remote.read()) 21 | except urllib2.URLError, e: 22 | raise "An error occured while downloading: %r" % e 23 | -------------------------------------------------------------------------------- /js/random.js: -------------------------------------------------------------------------------- 1 | Wolf.Random = (function() { 2 | 3 | /* This is just John Carmack's table driven pseudo-random number generator */ 4 | var rndtable = [ 5 | 0, 8, 109, 220, 222, 241, 149, 107, 75, 248, 254, 140, 16, 66, 6 | 74, 21, 211, 47, 80, 242, 154, 27, 205, 128, 161, 89, 77, 36, 7 | 95, 110, 85, 48, 212, 140, 211, 249, 22, 79, 200, 50, 28, 188, 8 | 52, 140, 202, 120, 68, 145, 62, 70, 184, 190, 91, 197, 152, 224, 9 | 149, 104, 25, 178, 252, 182, 202, 182, 141, 197, 4, 81, 181, 242, 10 | 145, 42, 39, 227, 156, 198, 225, 193, 219, 93, 122, 175, 249, 0, 11 | 175, 143, 70, 239, 46, 246, 163, 53, 163, 109, 168, 135, 2, 235, 12 | 25, 92, 20, 145, 138, 77, 69, 166, 78, 176, 173, 212, 166, 113, 13 | 94, 161, 41, 50, 239, 49, 111, 164, 70, 60, 2, 37, 171, 75, 14 | 136, 156, 11, 56, 42, 146, 138, 229, 73, 146, 77, 61, 98, 196, 15 | 135, 106, 63, 197, 195, 86, 96, 203, 113, 101, 170, 247, 181, 113, 16 | 80, 250, 108, 7, 255, 237, 129, 226, 79, 107, 112, 166, 103, 241, 17 | 24, 223, 239, 120, 198, 58, 60, 82, 128, 3, 184, 66, 143, 224, 18 | 145, 224, 81, 206, 163, 45, 63, 90, 168, 114, 59, 33, 159, 95, 19 | 28, 139, 123, 98, 125, 196, 15, 70, 194, 253, 54, 14, 109, 226, 20 | 71, 17, 161, 93, 186, 87, 244, 138, 20, 52, 123, 251, 26, 36, 21 | 17, 46, 52, 231, 232, 76, 31, 221, 84, 37, 216, 165, 212, 106, 22 | 197, 242, 98, 43, 39, 175, 254, 145, 190, 84, 118, 222, 187, 136, 23 | 120, 163, 236, 249 24 | ]; 25 | 26 | var rndindex = 0; 27 | 28 | function init(randomize) { 29 | if (randomize ) { 30 | rndindex = (new Date).getTime() & 0xFF; 31 | } else { 32 | rndindex = 0; 33 | } 34 | } 35 | 36 | function rnd() { 37 | rndindex++; 38 | rndindex &= 0xFF; 39 | return rndtable[rndindex]; 40 | } 41 | 42 | 43 | return { 44 | init : init, 45 | rnd : rnd 46 | } 47 | 48 | })(); -------------------------------------------------------------------------------- /js/load.js: -------------------------------------------------------------------------------- 1 | 2 | (function($) { 3 | 4 | // these files are preloaded while the title screen is showing 5 | var files = [ 6 | "js/wolf.js", 7 | "js/random.js", 8 | "js/angle.js", 9 | "js/math.js", 10 | "js/input.js", 11 | "js/sound.js", 12 | "js/menu.js", 13 | "js/file.js", 14 | "js/episodes.js", 15 | "js/maps.js", 16 | "js/game.js", 17 | "js/player.js", 18 | "js/sprites.js", 19 | "js/powerups.js", 20 | "js/ai.js", 21 | "js/actorai.js", 22 | "js/actors.js", 23 | "js/actstat.js", 24 | "js/weapon.js", 25 | "js/doors.js", 26 | "js/pushwall.js", 27 | "js/areas.js", 28 | "js/level.js", 29 | "js/raycaster.js", 30 | "js/renderer.js", 31 | 32 | "preload!art/menubg_main.png", 33 | "preload!art/menuitems.png", 34 | "preload!art/menuselector.png" 35 | 36 | ]; 37 | 38 | // these files are preloaded in the background after the menu is displayed. 39 | // only non-essential files here 40 | var files2 = [ 41 | "preload!art/menubg_episodes.png", 42 | "preload!art/menuitems_episodes.png", 43 | "preload!art/menubg_skill.png", 44 | "preload!art/menubg_levels.png", 45 | "preload!art/menuitems_levels.png", 46 | "preload!art/skillfaces.png", 47 | "preload!art/getpsyched.png", 48 | "preload!art/menubg_control.png", 49 | "preload!art/menulight.png", 50 | "preload!art/menubg_customize.png", 51 | "preload!art/control_keys.png", 52 | "preload!art/confirm_newgame.png", 53 | "preload!art/paused.png" 54 | ]; 55 | 56 | $(document).ready(function() { 57 | 58 | var progress = $("
"), 59 | n = 0; 60 | 61 | progress.addClass("load-progress").appendTo("#title-screen"); 62 | $("#title-screen").show(); 63 | 64 | 65 | yepnope.addPrefix("preload", function(resource) { 66 | resource.noexec = true; 67 | resource.instead = function(input, callback) { 68 | var image = new Image(); 69 | image.onload = callback; 70 | image.onerror = callback; 71 | image.src = input.substr(input.lastIndexOf("!")+1); 72 | }; 73 | return resource; 74 | }); 75 | 76 | 77 | Modernizr.load([ 78 | { 79 | test : window.requestAnimationFrame, 80 | nope : "js/requestAnimFrame.js" 81 | },{ 82 | test : window.atob && window.btoa, 83 | nope : "js/base64.js" 84 | },{ 85 | load : files, 86 | callback : function(file) { 87 | progress.width((++n / files.length) * 100 + "%"); 88 | }, 89 | complete : function() { 90 | progress.remove(); 91 | $("#title-screen").fadeOut(1500, function() { 92 | Wolf.Input.init(); 93 | Wolf.Game.init(); 94 | Wolf.Menu.show(); 95 | }); 96 | // preload non-essential art 97 | Modernizr.load(files2); 98 | } 99 | } 100 | ]); 101 | }); 102 | 103 | })(jQuery); -------------------------------------------------------------------------------- /js/angle.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @namespace 3 | * @description Angle math 4 | */ 5 | Wolf.Angle = (function() { 6 | 7 | Wolf.setConsts({ 8 | DEG2RAD : function(a) { return a * 0.01745329251994329576; }, // a * M_PI / 180.0f 9 | RAD2DEG : function(a) { return a / 0.01745329251994329576; }, // a * 180.0f / M_PI 10 | ANGLE2SHORT : function(x) { return ((x * 65536 / 360)>>0) & 65535; }, 11 | SHORT2ANGLE : function(x) { return x * 360.0 / 65536; } 12 | }); 13 | 14 | /** 15 | * @description Finds the difference between two angles. 16 | * @memberOf Wolf.Angle 17 | * @param {number} angle1 Angle in radians. 18 | * @param {number} angle2 Angle in radians. 19 | * @returns {number} The absolute difference between two angles, this will always be between 0 and 180 degrees. 20 | */ 21 | function diff(angle1, angle2) { 22 | var d; 23 | 24 | if (angle1 > angle2) { 25 | d = angle1 - angle2; 26 | } else { 27 | d = angle2 - angle1; 28 | } 29 | 30 | if (d > Math.PI) { 31 | return 2 * Math.PI - d; 32 | } else { 33 | return d; 34 | } 35 | } 36 | 37 | /** 38 | * @description Clockwise distance between two angles. 39 | * @memberOf Wolf.Angle 40 | * @param {number} angle1 Angle in radians. 41 | * @param {number} angle2 Angle in radians. 42 | * @returns {number} The clockwise distance from angle2 to angle1, this may be greater than 180 degrees. 43 | */ 44 | function distCW(angle1, angle2) { 45 | if (angle1 > angle2) { 46 | return angle1 - angle2; 47 | } else { 48 | return angle1 + 2 * Math.PI - angle2; 49 | } 50 | } 51 | 52 | /** 53 | * @description Linear interpolate between angle from and to by fraction frac. 54 | * @memberOf Wolf.Angle 55 | * @param {number} from Angle in radians. 56 | * @param {number} to Angle in radians. 57 | * @param {number} frac Fraction. 58 | * @returns {number} 59 | */ 60 | function interpolate(from, to, frac) { 61 | var d = diff(from, to) * frac; 62 | 63 | if (distCW(to, from) >= Math.PI) { 64 | return from - diff; 65 | } else { 66 | return from + diff; 67 | } 68 | } 69 | 70 | 71 | /** 72 | * @description Normalize angle. 73 | * @memberOf Wolf.Angle 74 | * @param {number} angle 75 | * @returns {number} 76 | */ 77 | function normalize(angle) { 78 | while (angle < 0) { 79 | angle += (2 * Math.PI); 80 | } 81 | while (angle >= (2 * Math.PI)) { 82 | angle -= (2 * Math.PI); 83 | } 84 | return angle; 85 | } 86 | 87 | 88 | 89 | /** 90 | * @description Linear interpolate allowing for the Modulo 360 problem. 91 | * @memberOf Wolf.Angle 92 | * @param {number} from Angle in radians. 93 | * @param {number} to Angle in radians. 94 | * @param {number} frac fraction. 95 | * @returns {number} 96 | */ 97 | 98 | function lerp(from, to, frac) { 99 | if (to - from > 180) { 100 | to -= 360; 101 | } 102 | if (to - from < -180) { 103 | to += 360; 104 | } 105 | return from + frac * (to - from); 106 | } 107 | 108 | return { 109 | diff : diff, 110 | distCW : distCW, 111 | normalize : normalize, 112 | interpolate : interpolate, 113 | lerp : lerp 114 | } 115 | 116 | })(); -------------------------------------------------------------------------------- /js/wolf.js: -------------------------------------------------------------------------------- 1 | /** @namespace */ 2 | var Wolf = { 3 | 4 | XRES : 608, 5 | YRES : 304, 6 | SLICE_WIDTH : 3, 7 | WALL_TEXTURE_WIDTH : 64, 8 | NUM_WALL_TEXTURES : 55, 9 | HUD_FACE_WIDTH : 48, 10 | HUD_FACE_HEIGHT : 64, 11 | HUD_WEAPON_WIDTH : 256, 12 | 13 | 14 | NUMAREAS : 37, // number of areas 15 | FIRSTAREA : 0x6B, // first area in map data (it is by the way a way to the secret floor!) 16 | AMBUSHTILE : 0x6A, // def guard 17 | AMBUSH : -2, 18 | 19 | TILEGLOBAL : 0x10000, 20 | HALFTILE : 0x8000, 21 | TILESHIFT : 16, 22 | MINDIST : 0x5800, 23 | FLOATTILE : 65536.0, 24 | 25 | TILE2POS : function(a) { return (((a)<>Wolf.TILESHIFT); }, 27 | POS2TILEf : function(a) { return ((a)/Wolf.FLOATTILE); }, 28 | 29 | ASTEP : 0.0078125, // 1 FINE=x DEGREES 30 | ASTEPRAD : 0.000136354, // 1 FINE=x RADIANS 31 | ANG_1RAD : 7333.8598, // 1 RADIAN=x FINES 32 | ANG_0 : 0, //(int)((float)0/ASTEP) 33 | ANG_1 : 128, //(int)((float)1/ASTEP) 34 | ANG_6 : 768, //(int)((float)6/ASTEP) 35 | ANG_15 : 1920, //(int)((float)15/ASTEP) 36 | ANG_22_5 : 2880, //(int)((float)22.5/ASTEP) 37 | ANG_30 : 3840, //(int)((float)30/ASTEP) 38 | ANG_45 : 5760, //(int)((float)45/ASTEP) 39 | ANG_67_5 : 8640, //(int)((float)67.5/ASTEP) 40 | ANG_90 : 11520, //(int)((float)90/ASTEP) 41 | ANG_112_5 : 14400, //(int)((float)112.5/ASTEP) 42 | ANG_135 : 17280, //(int)((float)135/ASTEP) 43 | ANG_157_5 : 20160, //(int)((float)157.5/ASTEP) 44 | ANG_180 : 23040, //(int)((float)180/ASTEP) 45 | ANG_202_5 : 25920, //(int)((float)202.5/ASTEP) 46 | ANG_225 : 28800, //(int)((float)225/ASTEP) 47 | ANG_247_5 : 31680, //(int)((float)247.5/ASTEP) 48 | ANG_270 : 34560, //(int)((float)270/ASTEP) 49 | ANG_292_5 : 37440, //(int)((float)292.5/ASTEP) 50 | ANG_315 : 40320, //(int)((float)225/ASTEP) 51 | ANG_337_5 : 43200, //(int)((float)337.5/ASTEP) 52 | ANG_360 : 46080, //(int)((float)360/ASTEP) 53 | 54 | ANGLES : 360, // must be divisable by 4 55 | DEATHROTATE : 2, 56 | 57 | FINE2RAD : function(a) { return (a * Math.PI / Wolf.ANG_180); }, 58 | RAD2FINE : function(a) { return (a * Wolf.ANG_180 / Math.PI); }, 59 | FINE2DEG : function(a) { return (a / Wolf.ANG_1) >> 0; }, // !@# don't lose precision bits 60 | FINE2DEGf : function(a) { return (a / Wolf.ANG_1); }, 61 | DEG2FINE : function(a) { return (a * Wolf.ANG_1); }, 62 | 63 | }; 64 | 65 | Wolf.setConsts = function(C) { 66 | for (var a in C) { 67 | if (C.hasOwnProperty(a) && !(a in Wolf)) { 68 | Wolf[a] = C[a]; 69 | } 70 | } 71 | }; 72 | 73 | Wolf.noop = function() {}; 74 | 75 | Wolf.log = function(str) { 76 | if (typeof console != "undefined") { 77 | var t = new Date(), 78 | e = new Error(), 79 | f = ""; 80 | if (typeof str == "object" && typeof e.stack == "string") { 81 | // ugly hack to get some kind of reference to where the log call originated 82 | var s = e.stack.split("\n")[2]+"", 83 | m = s.match(/at (.*)$/); 84 | f = m ? "\t[" + m[1] + "]" : ""; 85 | } 86 | console.log(t.toLocaleTimeString() + ": " + str + f); 87 | } 88 | }; 89 | 90 | -------------------------------------------------------------------------------- /js/areas.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @namespace 3 | * @description Area management 4 | */ 5 | Wolf.Areas = (function() { 6 | /* 7 | Notes: 8 | 9 | Open doors connect two areas, so sounds will travel between them and sight 10 | will be checked when the player is in a connected area. 11 | 12 | Areaconnect is incremented/decremented by each door. If >0 they connect. 13 | 14 | Every time a door opens or closes the areabyplayer matrix gets recalculated. 15 | An area is true if it connects with the player's current spor. 16 | 17 | */ 18 | 19 | /** 20 | * @description Initialize areas 21 | * @memberOf Wolf.Areas 22 | * @param {object} levelState The level state object 23 | * @param {number} areanumber Initial area 24 | */ 25 | function init(level, areanumber) { 26 | level.state.areaconnect = []; 27 | level.state.areabyplayer = []; 28 | for (var i=0;i= Wolf.NUMAREAS) { 64 | throw new Error("areanumber >= Wolf.NUMAREAS"); 65 | } 66 | 67 | level.state.areabyplayer = []; 68 | level.state.areabyplayer[areanumber] = true; 69 | 70 | recursiveConnect(level, areanumber); 71 | for (i = 0; i < Wolf.NUMAREAS; i++) { 72 | if (level.state.areabyplayer[i]) { 73 | c++; 74 | } 75 | } 76 | } 77 | 78 | /** 79 | * @description Join ares 80 | * @memberOf Wolf.Areas 81 | * @param {object} level The level object 82 | * @param {number} area1 Area 1 83 | * @param {number} area2 Area 2 84 | */ 85 | function join(level, area1, area2) { 86 | if (area1 < 0 || area1 >= Wolf.NUMAREAS) { 87 | throw new Error("area1 < 0 || area1 >= Wolf.NUMAREAS"); 88 | } 89 | if (area2 < 0 || area2 >= Wolf.NUMAREAS) { 90 | throw new Error("area2 < 0 || area2 >= Wolf.NUMAREAS"); 91 | } 92 | level.state.areaconnect[area1][area2]++; 93 | level.state.areaconnect[area2][area1]++; 94 | } 95 | 96 | /** 97 | * @description Disconnect ares 98 | * @memberOf Wolf.Areas 99 | * @param {object} level The level object 100 | * @param {number} area1 Area 1 101 | * @param {number} area2 Area 2 102 | */ 103 | function disconnect(level, area1, area2) { 104 | if (area1 < 0 || area1 >= Wolf.NUMAREAS) { 105 | throw new Error("area1 < 0 || area1 >= Wolf.NUMAREAS"); 106 | } 107 | if (area2 < 0 || area2 >= Wolf.NUMAREAS) { 108 | throw new Error("area2 < 0 || area2 >= Wolf.NUMAREAS"); 109 | } 110 | level.state.areaconnect[area1][area2]--; 111 | level.state.areaconnect[area2][area1]--; 112 | } 113 | 114 | return { 115 | init : init, 116 | connect : connect, 117 | join : join, 118 | disconnect : disconnect 119 | }; 120 | 121 | })(); 122 | 123 | -------------------------------------------------------------------------------- /js/pushwall.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @namespace 3 | * @description Push wall management 4 | */ 5 | Wolf.PushWall = (function() { 6 | 7 | var PWall = {}; 8 | reset(); 9 | 10 | function reset() { 11 | PWall.active = false; 12 | PWall.tilesMoved = 0; 13 | PWall.pointsMoved = 0; 14 | PWall.dir = 0; 15 | PWall.x = 0; 16 | PWall.y = 0; 17 | PWall.dx = 0; 18 | PWall.dy = 0; 19 | PWall.texX = 0; 20 | PWall.texY = 0; 21 | } 22 | 23 | 24 | function push(level, x, y, dir) { 25 | var dx, dy; 26 | 27 | if (PWall.active) { 28 | return false; // another PWall is moving [only one at a time!] 29 | } 30 | 31 | dx = Wolf.Math.dx4dir[dir]; 32 | dy = Wolf.Math.dy4dir[dir]; 33 | 34 | if (level.tileMap[x + dx][y + dy] & (Wolf.SOLID_TILE | Wolf.DOOR_TILE)) { 35 | // noway (smth is blocking) 36 | return true; 37 | } 38 | 39 | // remove secret flag & make everything needed when pushwall used! 40 | level.tileMap[x][y] &= (~Wolf.SECRET_TILE); 41 | level.tileMap[x][y] &= (~Wolf.WALL_TILE); 42 | level.tileMap[x][y] |= Wolf.PUSHWALL_TILE; 43 | 44 | if (++level.state.foundSecrets == level.state.totalSecrets) { 45 | Wolf.Game.notify("You found the last secret!"); 46 | } else { 47 | Wolf.Game.notify("You found a secret!"); 48 | } 49 | 50 | Wolf.Sound.startSound(null, null, 1, Wolf.CHAN_AUTO, "sfx/034.wav", 1, Wolf.ATTN_STATIC, 0); 51 | 52 | // good way to avoid stuckness; [un]comment one more down! 53 | // it makes a tile behind pushwall unpassable 54 | level.tileMap[x + dx][y + dy] |= Wolf.PUSHWALL_TILE; 55 | level.wallTexX[x + dx][y + dy] = level.wallTexX[x][y]; 56 | level.wallTexY[x + dx][y + dy] = level.wallTexY[x][y]; 57 | 58 | // write down PWall info 59 | PWall.active = true; 60 | PWall.tilesMoved = PWall.pointsMoved = 0; 61 | PWall.dir = dir; 62 | PWall.x = x; 63 | PWall.y = y; 64 | PWall.dx = dx; 65 | PWall.dy = dy; 66 | PWall.texX = level.wallTexX[x][y]; 67 | PWall.texY = level.wallTexY[x][y]; 68 | 69 | return true; 70 | } 71 | 72 | 73 | /* 74 | ----------------------------------------------------------------------------- 75 | Function: PushWall_Process() -Process push-walls. 76 | ----------------------------------------------------------------------------- 77 | */ 78 | function process(level, tics) { 79 | if (!PWall.active) { 80 | return; // no active PWall to work with 81 | } 82 | 83 | PWall.pointsMoved += tics; 84 | 85 | if (PWall.pointsMoved < 128) { 86 | return; 87 | } 88 | 89 | PWall.pointsMoved -= 128; 90 | PWall.tilesMoved++; 91 | // Free tile 92 | level.tileMap[PWall.x][PWall.y] &= (~Wolf.PUSHWALL_TILE); 93 | // Occupy new tile 94 | PWall.x += PWall.dx; 95 | PWall.y += PWall.dy; 96 | 97 | // Shall we move further? 98 | if (level.tileMap[PWall.x + PWall.dx][PWall.y + PWall.dy] & (Wolf.SOLID_TILE | Wolf.DOOR_TILE | Wolf.ACTOR_TILE | Wolf.POWERUP_TILE) || PWall.tilesMoved == 3) { 99 | level.tileMap[PWall.x][PWall.y] &= (~Wolf.PUSHWALL_TILE); // wall now 100 | level.tileMap[PWall.x][PWall.y] |= Wolf.WALL_TILE; // wall now 101 | level.wallTexX[PWall.x][PWall.y] = PWall.texX; 102 | level.wallTexY[PWall.x][PWall.y] = PWall.texY; 103 | PWall.active = false; // Free Push Wall 104 | } else { 105 | level.tileMap[PWall.x + PWall.dx][PWall.y + PWall.dy] |= Wolf.PUSHWALL_TILE; 106 | 107 | // Not sure if this is right but it fixed an issue with the pushwall texture changing mid-slide. 108 | level.wallTexX[PWall.x + PWall.dx][PWall.y + PWall.dy] = PWall.texX; 109 | level.wallTexY[PWall.x + PWall.dx][PWall.y + PWall.dy] = PWall.texY; 110 | } 111 | } 112 | 113 | function get() { 114 | return PWall; 115 | } 116 | 117 | return { 118 | reset : reset, 119 | process : process, 120 | push : push, 121 | get : get 122 | }; 123 | 124 | })(); 125 | -------------------------------------------------------------------------------- /js/episodes.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @namespace 3 | * @description Episode data 4 | */ 5 | Wolf.Episodes = [ 6 | { 7 | name : "Escape from Wolfenstein", 8 | enabled : true, 9 | levels : [ 10 | { file : "maps/w00.map", partime : 1.5 }, 11 | { file : "maps/w01.map", partime : 2.0 }, 12 | { file : "maps/w02.map", partime : 2.0 }, 13 | { file : "maps/w03.map", partime : 3.5 }, 14 | { file : "maps/w04.map", partime : 3.0 }, 15 | { file : "maps/w05.map", partime : 3.0 }, 16 | { file : "maps/w06.map", partime : 2.5 }, 17 | { file : "maps/w07.map", partime : 2.5 }, 18 | { file : "maps/w08.map", partime : 0.0 }, 19 | { file : "maps/w09.map", partime : 0.0, secret : true } 20 | ] 21 | },{ 22 | name : "Operation: Eisenfaust", 23 | enabled : true, 24 | levels : [ 25 | { file : "maps/w10.map", partime : 1.5 }, 26 | { file : "maps/w11.map", partime : 3.5 }, 27 | { file : "maps/w12.map", partime : 3.0 }, 28 | { file : "maps/w13.map", partime : 2.0 }, 29 | { file : "maps/w14.map", partime : 4.0 }, 30 | { file : "maps/w15.map", partime : 6.0 }, 31 | { file : "maps/w16.map", partime : 1.0 }, 32 | { file : "maps/w17.map", partime : 3.0 }, 33 | { file : "maps/w18.map", partime : 0.0 }, 34 | { file : "maps/w19.map", partime : 0.0, secret : true } 35 | ] 36 | },{ 37 | name : "Die, Fuhrer, Die!", 38 | enabled : true, 39 | levels : [ 40 | { file : "maps/w20.map", partime : 1.5 }, 41 | { file : "maps/w21.map", partime : 1.5 }, 42 | { file : "maps/w22.map", partime : 2.5 }, 43 | { file : "maps/w23.map", partime : 2.5 }, 44 | { file : "maps/w24.map", partime : 3.5 }, 45 | { file : "maps/w25.map", partime : 2.5 }, 46 | { file : "maps/w26.map", partime : 2.0 }, 47 | { file : "maps/w27.map", partime : 6.0 }, 48 | { file : "maps/w28.map", partime : 0.0 }, 49 | { file : "maps/w29.map", partime : 0.0, secret : true } 50 | ] 51 | },{ 52 | name : "A Dark Secret", 53 | enabled : true, 54 | levels : [ 55 | { file : "maps/w30.map", partime : 2.0 }, 56 | { file : "maps/w31.map", partime : 2.0 }, 57 | { file : "maps/w32.map", partime : 1.5 }, 58 | { file : "maps/w33.map", partime : 1.0 }, 59 | { file : "maps/w34.map", partime : 4.5 }, 60 | { file : "maps/w35.map", partime : 3.5 }, 61 | { file : "maps/w36.map", partime : 2.0 }, 62 | { file : "maps/w37.map", partime : 4.5 }, 63 | { file : "maps/w38.map", partime : 0.0 }, 64 | { file : "maps/w39.map", partime : 0.0, secret : true } 65 | ] 66 | },{ 67 | name : "Trail of the Madman", 68 | enabled : true, 69 | levels : [ 70 | { file : "maps/w40.map", partime : 2.5 }, 71 | { file : "maps/w41.map", partime : 1.5 }, 72 | { file : "maps/w42.map", partime : 2.5 }, 73 | { file : "maps/w43.map", partime : 2.5 }, 74 | { file : "maps/w44.map", partime : 4.0 }, 75 | { file : "maps/w45.map", partime : 3.0 }, 76 | { file : "maps/w46.map", partime : 4.5 }, 77 | { file : "maps/w47.map", partime : 3.5 }, 78 | { file : "maps/w48.map", partime : 0.0 }, 79 | { file : "maps/w49.map", partime : 0.0, secret : true } 80 | ] 81 | },{ 82 | name : "Confrontation", 83 | enabled : true, 84 | levels : [ 85 | { file : "maps/w50.map", partime : 6.5 }, 86 | { file : "maps/w51.map", partime : 4.0 }, 87 | { file : "maps/w52.map", partime : 4.5 }, 88 | { file : "maps/w53.map", partime : 6.0 }, 89 | { file : "maps/w54.map", partime : 5.0 }, 90 | { file : "maps/w55.map", partime : 5.5 }, 91 | { file : "maps/w56.map", partime : 5.5 }, 92 | { file : "maps/w57.map", partime : 8.5 }, 93 | { file : "maps/w58.map", partime : 0.0 }, 94 | { file : "maps/w59.map", partime : 0.0, secret : true } 95 | ] 96 | } 97 | ]; 98 | 99 | -------------------------------------------------------------------------------- /js/weapon.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @namespace 3 | * @description Weapons 4 | */ 5 | Wolf.Weapon = (function() { 6 | 7 | 8 | function fireHit(game, player) { 9 | var level = game.level, 10 | closest, 11 | dist, 12 | d1, 13 | n, 14 | shotDist, 15 | damage, 16 | guard; 17 | 18 | Wolf.Sound.startSound(null, null, 0, Wolf.CHAN_WEAPON, "lsfx/023.wav", 1, Wolf.ATTN_NORM, 0); 19 | 20 | // actually fire 21 | dist = 0x7fffffff; 22 | closest = null; 23 | 24 | for (n=0; n (2 * Wolf.TILEGLOBAL / 3)) { 30 | continue; // miss 31 | } 32 | 33 | d1 = Wolf.Math.lineLen2Point(guard.x - player.position.x, guard.y - player.position.y, player.angle); 34 | 35 | if (d1 < 0 || d1 > dist) { 36 | continue; 37 | } 38 | 39 | if (!Wolf.Level.checkLine(guard.x, guard.y, player.position.x, player.position.y, level)) { 40 | continue; // obscured 41 | } 42 | dist = d1; 43 | closest = guard; 44 | } 45 | } 46 | 47 | if (!closest || dist > Wolf.TILE2POS(1)) { 48 | return; // missed if further than 1.5 tiles 49 | } 50 | 51 | damage = Wolf.Random.rnd() >> 4; 52 | 53 | Wolf.ActorAI.damageActor(closest, game, player, damage); // hit something 54 | } 55 | 56 | 57 | function fireLead(game, player) { 58 | var level = game.level, 59 | closest, 60 | damage, 61 | dx, dy, dist, 62 | d1, shotDist, n, 63 | guard; 64 | 65 | switch (player.weapon) { 66 | case Wolf.WEAPON_PISTOL: 67 | Wolf.Sound.startSound(null, null, 0, Wolf.CHAN_WEAPON, "sfx/012.wav", 1, Wolf.ATTN_NORM, 0); 68 | break; 69 | 70 | case Wolf.WEAPON_AUTO: 71 | Wolf.Sound.startSound(null, null, 0, Wolf.CHAN_WEAPON, "sfx/011.wav", 1, Wolf.ATTN_NORM, 0); 72 | break; 73 | 74 | case Wolf.WEAPON_CHAIN: 75 | Wolf.Sound.startSound(null, null, 0, Wolf.CHAN_WEAPON, "sfx/013.wav", 1, Wolf.ATTN_NORM, 0); 76 | break; 77 | } 78 | 79 | player.madenoise = true; 80 | 81 | dist = 0x7fffffff; 82 | closest = null; 83 | 84 | for (n=0;n < level.state.numGuards; ++n) { 85 | guard = level.state.guards[n]; 86 | if (guard.flags & Wolf.FL_SHOOTABLE ) { // && Guards[n].flags&FL_VISABLE 87 | shotDist = Wolf.Math.point2LineDist(guard.x - player.position.x, guard.y - player.position.y, player.angle); 88 | if (shotDist > (2 * Wolf.TILEGLOBAL / 3)) { 89 | continue; // miss 90 | } 91 | 92 | d1 = Wolf.Math.lineLen2Point(guard.x - player.position.x, guard.y - player.position.y, player.angle); 93 | if (d1 < 0 || d1 > dist) { 94 | continue; 95 | } 96 | if (!Wolf.Level.checkLine(guard.x, guard.y, player.position.x, player.position.y, level)) { 97 | continue; // obscured 98 | } 99 | 100 | dist = d1; 101 | closest = guard; 102 | } 103 | } 104 | 105 | if (!closest) { // missed 106 | var tracePoint = { 107 | angle : Wolf.Math.normalizeAngle(player.angle - Wolf.DEG2FINE(2) + (Math.random() * 0x10000) % (Wolf.DEG2FINE(4))), 108 | x : player.position.x, 109 | y : player.position.y, 110 | flags : Wolf.TRACE_BULLET 111 | } 112 | 113 | Wolf.Raycaster.trace(level, null, tracePoint); 114 | 115 | if (tracePoint.flags & Wolf.TRACE_HIT_DOOR) { 116 | Wolf.Sound.startSound(null, null, 0, Wolf.CHAN_AUTO, "lsfx/028.wav", 1, Wolf.ATTN_NORM, 0); 117 | } 118 | 119 | return; 120 | } 121 | 122 | // hit something 123 | dx = Math.abs(closest.tile.x - player.tile.x); 124 | dy = Math.abs(closest.tile.y - player.tile.y); 125 | dist = Math.max(dx, dy); 126 | 127 | if (dist < 2) { 128 | damage = Wolf.Random.rnd() / 4; 129 | } else if (dist < 4) { 130 | damage = Wolf.Random.rnd() / 6; 131 | } else { 132 | if (Wolf.Random.rnd() / 12 < dist) { 133 | return; // missed 134 | } 135 | damage = Wolf.Random.rnd() / 6; 136 | } 137 | 138 | Wolf.ActorAI.damageActor(closest, game, player, damage); 139 | } 140 | 141 | 142 | 143 | return { 144 | fireHit : fireHit, 145 | fireLead : fireLead 146 | }; 147 | 148 | 149 | })(); -------------------------------------------------------------------------------- /js/file.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @namespace 3 | * @description Binary file reading 4 | */ 5 | Wolf.File = (function() { 6 | 7 | 8 | /** 9 | * @description Open a file from URL 10 | * @memberOf Wolf.File 11 | * @param {string} url The URL to open 12 | * @param {function} callback Is called when file has been loaded. Second argument is file obj. 13 | */ 14 | function openURL(url, callback) { 15 | var xhr = new XMLHttpRequest(); 16 | 17 | xhr.onreadystatechange = function() { 18 | if (xhr.readyState == 4) { 19 | if (xhr.status >= 200 && xhr.status < 300 || xhr.status == 0) { 20 | callback(null, { 21 | data : xhr.responseText, 22 | size : xhr.responseText.length, 23 | position : 0 24 | }); 25 | } else { 26 | callback(new Error("Server returned HTTP status: " + xhr.status)); 27 | } 28 | } 29 | } 30 | xhr.open("GET", url, true); 31 | xhr.overrideMimeType('text/plain; charset=x-user-defined'); 32 | xhr.send(null); 33 | } 34 | 35 | /** 36 | * @description Open a file from base64 filetable 37 | * @memberOf Wolf.File 38 | * @param {string} filename The name of the file to open 39 | * @param {object} files The filetable 40 | * @param {function} callback Is called when file has been loaded. Second argument is file obj. 41 | */ 42 | function open(filename, files, callback) { 43 | var b64data = files[filename]; 44 | if (b64data) { 45 | var data = atob(b64data); 46 | callback(null, { 47 | data : data, 48 | size : data.length, 49 | position : 0 50 | }); 51 | } else { 52 | callback(new Error("File not found: " + filename)); 53 | } 54 | } 55 | 56 | /** 57 | * @description Read an unsigned 8-bit integer from a file and advance the file position. 58 | * @memberOf Wolf.File 59 | * @param {object} f The file 60 | * @returns {number} 61 | */ 62 | function readUInt8(f) { 63 | var b = f.data.charCodeAt(f.position) & 0xFF 64 | f.position++; 65 | return b; 66 | } 67 | 68 | /** 69 | * @description Read a signed 8-bit integer from a file and advance the file position. 70 | * @memberOf Wolf.File 71 | * @param {object} f The file 72 | * @returns {number} 73 | */ 74 | function readInt8(f) { 75 | var v = readUInt8(f); 76 | return v > 127 ? v - 256 : v; 77 | } 78 | 79 | /** 80 | * @description Read an unsigned 16-bit integer from a file and advance the file position. 81 | * @memberOf Wolf.File 82 | * @param {object} f The file 83 | * @returns {number} 84 | */ 85 | function readUInt16(f) { 86 | var v = readUInt8(f) + (readUInt8(f) << 8); 87 | return (v < 0) ? v + 0x10000 : v; 88 | } 89 | 90 | /** 91 | * @description Read a signed 16-bit integer from a file and advance the file position. 92 | * @memberOf Wolf.File 93 | * @param {object} f The file 94 | * @returns {number} 95 | */ 96 | function readInt16(f) { 97 | var v = readUInt16(f); 98 | return (v > 0x7fff) ? v - 0x10000 : v; 99 | } 100 | 101 | /** 102 | * @description Read an unsigned 32-bit integer from a file and advance the file position. 103 | * @memberOf Wolf.File 104 | * @param {object} f The file 105 | * @returns {number} 106 | */ 107 | function readUInt32(f) { 108 | var b0 = readUInt8(f), 109 | b1 = readUInt8(f), 110 | b2 = readUInt8(f), 111 | b3 = readUInt8(f), 112 | v = ((((b3 << 8) + b2) << 8) + b1 << 8) + b0; 113 | return (v < 0) ? v + 0x100000000 : v; 114 | } 115 | 116 | /** 117 | * @description Read a signed 32-bit int from a file and advance the file position. 118 | * @memberOf Wolf.File 119 | * @param {object} f The file 120 | * @returns {number} 121 | */ 122 | function readInt32(f) { 123 | var v = readUInt32(f); 124 | return (v > 0x7fffffff) ? v - 0x100000000 : v; 125 | } 126 | 127 | /** 128 | * @description Read a string from a file and advance the file position. 129 | * @memberOf Wolf.File 130 | * @param {object} f The file 131 | * @param {number} length The length of the string 132 | * @returns {string} 133 | */ 134 | function readString(f, length) { 135 | var str = f.data.substr(f.position, length); 136 | f.position += length; 137 | return str; 138 | } 139 | 140 | /** 141 | * @description Read an array of bytes a file and advance the file position. 142 | * @memberOf Wolf.File 143 | * @param {object} f The file 144 | * @param {number} num The number of bytes to read 145 | * @returns {array} 146 | */ 147 | function readBytes(f, num) { 148 | var b = []; 149 | for (var i=0;i 0) { 111 | audioElements[i].currentTime = 0; 112 | audioElements[i].pause(); 113 | } 114 | } 115 | } 116 | 117 | function init() { 118 | } 119 | 120 | 121 | function isMusicEnabled() { 122 | return musicEnabled 123 | } 124 | 125 | function isSoundEnabled() { 126 | return soundEnabled; 127 | } 128 | 129 | function toggleMusic(enable) { 130 | if (typeof enable != "undefined") { 131 | musicEnabled = enable; 132 | } else { 133 | musicEnabled = !musicEnabled; 134 | } 135 | if (music) { 136 | music.volume = Wolf.MUSIC_VOLUME * Wolf.MASTER_VOLUME * (musicEnabled ? 1 : 0); 137 | } 138 | } 139 | 140 | function pauseMusic(enable) { 141 | if (music) { 142 | if (enable) { 143 | music.pause(); 144 | } else if (music.paused) { 145 | music.play(); 146 | } 147 | } 148 | } 149 | 150 | function toggleSound(enable) { 151 | if (typeof enable != "undefined") { 152 | soundEnabled = enable; 153 | } else { 154 | soundEnabled = !soundEnabled; 155 | } 156 | } 157 | 158 | if (Modernizr.audio) { 159 | return { 160 | startSound : startSound, 161 | startMusic : startMusic, 162 | stopAllSounds : stopAllSounds, 163 | isMusicEnabled : isMusicEnabled, 164 | isSoundEnabled : isSoundEnabled, 165 | toggleMusic : toggleMusic, 166 | toggleSound : toggleSound, 167 | pauseMusic : pauseMusic, 168 | init : init 169 | } 170 | } else { 171 | return { 172 | startSound : Wolf.noop, 173 | startMusic : Wolf.noop, 174 | stopAllSounds : Wolf.noop, 175 | isMusicEnabled : Wolf.noop, 176 | isSoundEnabled : Wolf.noop, 177 | toggleMusic : Wolf.noop, 178 | toggleSound : Wolf.noop, 179 | pauseMusic : Wolf.noop, 180 | init : Wolf.noop 181 | } 182 | } 183 | })(); -------------------------------------------------------------------------------- /js/raycaster.js: -------------------------------------------------------------------------------- 1 | Wolf.setConsts({ 2 | UPPERZCOORD : 0.6, 3 | LOWERZCOORD : -0.6, 4 | 5 | // marks 6 | TRACE_MARK_MAP : 1, // marks traced area in 'AM_AutoMap.vis' array 7 | // obstacle levels 8 | TRACE_SIGHT : 2, // player sight 9 | TRACE_SIGHT_AI : 4, // enemy sight 10 | TRACE_BULLET : 8, // bullet 11 | TRACE_OBJECT : 16, // object 12 | 13 | TRACE_HIT_VERT : 32, // vertical wall was hit 14 | TRACE_HIT_DOOR : 64, // door was hit 15 | TRACE_HIT_PWALL : 128 // pushwall was hit 16 | }); 17 | 18 | Wolf.Raycaster = (function() { 19 | 20 | var x_tile_step = [ 1, -1, -1, 1 ], 21 | y_tile_step = [ 1, 1, -1, -1 ]; 22 | 23 | var TILESHIFT = Wolf.TILESHIFT, 24 | TRACE_HIT_VERT = Wolf.TRACE_HIT_VERT, 25 | TILEGLOBAL = Wolf.TILEGLOBAL, 26 | WALL_TILE = Wolf.WALL_TILE, 27 | DOOR_TILE = Wolf.DOOR_TILE, 28 | TILE2POS = Wolf.TILE2POS, 29 | POS2TILE = Wolf.POS2TILE, 30 | FINE2RAD = Wolf.FINE2RAD, 31 | TRACE_HIT_DOOR = Wolf.TRACE_HIT_DOOR, 32 | PUSHWALL_TILE = Wolf.PUSHWALL_TILE, 33 | TRACE_HIT_PWALL = Wolf.TRACE_HIT_PWALL, 34 | DOOR_FULLOPEN = Wolf.DOOR_FULLOPEN, 35 | XnextTable = Wolf.Math.XnextTable, 36 | YnextTable = Wolf.Math.YnextTable, 37 | getQuadrant = Wolf.Math.getQuadrant, 38 | TanTable = Wolf.Math.TanTable; 39 | 40 | function traceCheck(tileMap, doorMap, visibleTiles, x, y, frac, dfrac, vert, flip, tracePoint) { 41 | var door; 42 | 43 | if (tileMap[x][y] & WALL_TILE) { 44 | if (vert) { 45 | tracePoint.x = (x << TILESHIFT) + (flip ? TILEGLOBAL : 0); 46 | tracePoint.y = (y << TILESHIFT) + frac; 47 | tracePoint.flags |= TRACE_HIT_VERT; 48 | } else { 49 | tracePoint.x = (x << TILESHIFT) + frac; 50 | tracePoint.y = (y << TILESHIFT) + (flip ? TILEGLOBAL : 0); 51 | tracePoint.flags &= ~TRACE_HIT_VERT; 52 | } 53 | tracePoint.tileX = x; 54 | tracePoint.tileY = y; 55 | tracePoint.frac = frac / TILEGLOBAL; 56 | 57 | return true; // wall, stop tracing 58 | } 59 | 60 | if (visibleTiles) { 61 | visibleTiles[x][y] = true; // this tile is visible 62 | } 63 | 64 | if (tileMap[x][y] & DOOR_TILE && doorMap[x][y].action != Wolf.dr_open) { 65 | door = doorMap[x][y]; 66 | 67 | frac += dfrac >> 1; 68 | 69 | if (POS2TILE(frac)) { 70 | return false; 71 | } 72 | 73 | if (vert) { 74 | if (door.action != Wolf.dr_closed && (frac >> 10) > DOOR_FULLOPEN - Wolf.Doors.opened(door)) { 75 | return false; // opened enough 76 | } 77 | tracePoint.x = TILE2POS(x); 78 | tracePoint.y = (y << TILESHIFT) + frac; 79 | tracePoint.flags |= TRACE_HIT_VERT; 80 | tracePoint.frac = frac / TILEGLOBAL; 81 | } else { 82 | if (door.action != Wolf.dr_closed && (frac >> 10) < Wolf.Doors.opened(door)) { 83 | return false; // opened enough 84 | } 85 | tracePoint.y = TILE2POS(y); 86 | tracePoint.x = (x << TILESHIFT) + frac; 87 | tracePoint.flags &= ~TRACE_HIT_VERT; 88 | tracePoint.frac = 1 - frac / TILEGLOBAL; 89 | } 90 | 91 | tracePoint.flags |= TRACE_HIT_DOOR; 92 | tracePoint.tileX = x; 93 | tracePoint.tileY = y; 94 | tracePoint.frac += Wolf.Doors.opened(door) / DOOR_FULLOPEN; 95 | return true; // closed door, stop tracing 96 | } 97 | 98 | 99 | if (tileMap[x][y] & PUSHWALL_TILE) { 100 | 101 | var pwall = Wolf.PushWall.get(), 102 | offset = pwall.pointsMoved / 128; 103 | 104 | frac += dfrac * offset; 105 | 106 | if (POS2TILE(frac)) { 107 | return false; 108 | } 109 | 110 | if (vert) { 111 | tracePoint.x = (x << TILESHIFT) + (flip ? TILEGLOBAL : 0) + offset * TILEGLOBAL * (flip ? -1 : 1); 112 | tracePoint.y = (y << TILESHIFT) + frac; 113 | tracePoint.flags |= TRACE_HIT_VERT; 114 | } else { 115 | tracePoint.x = (x << TILESHIFT) + frac; 116 | tracePoint.y = (y << TILESHIFT) + (flip ? TILEGLOBAL : 0) + offset * TILEGLOBAL * (flip ? -1 : 1); 117 | tracePoint.flags &= ~TRACE_HIT_VERT; 118 | } 119 | 120 | tracePoint.flags |= TRACE_HIT_PWALL; 121 | tracePoint.tileX = x; 122 | tracePoint.tileY = y; 123 | tracePoint.frac = frac / TILEGLOBAL; 124 | return true; 125 | } 126 | 127 | return false; // no intersection, go on! 128 | } 129 | 130 | function trace(level, visibleTiles, tracePoint) { 131 | var xtilestep, ytilestep, 132 | xstep, ystep, 133 | xtile, ytile, 134 | xintercept, yintercept, 135 | YmapPos, XmapPos, 136 | tileMap = level.tileMap, 137 | doorMap = level.state.doorMap, 138 | q; 139 | 140 | // Setup for ray casting 141 | q = getQuadrant(FINE2RAD(tracePoint.angle)); 142 | 143 | xtilestep = x_tile_step[q]; 144 | ytilestep = y_tile_step[q]; 145 | 146 | xtile = POS2TILE(tracePoint.x) + xtilestep; 147 | ytile = POS2TILE(tracePoint.y) + ytilestep; 148 | 149 | xstep = ytilestep * XnextTable[tracePoint.angle]; 150 | ystep = xtilestep * YnextTable[tracePoint.angle]; 151 | 152 | xintercept = (((((ytilestep == -1 ? ytile+1 : ytile) << TILESHIFT) - tracePoint.y) 153 | / TanTable[tracePoint.angle])>>0) + tracePoint.x; 154 | yintercept = (((((xtilestep == -1 ? xtile+1 : xtile) << TILESHIFT) - tracePoint.x) 155 | * TanTable[tracePoint.angle])>>0) + tracePoint.y; 156 | 157 | YmapPos = yintercept >> TILESHIFT; // toXray 158 | XmapPos = xintercept >> TILESHIFT; // toYray 159 | 160 | if (visibleTiles) { 161 | // this tile is visible 162 | visibleTiles[POS2TILE(tracePoint.x)][POS2TILE(tracePoint.y)] = true; 163 | } 164 | 165 | var traceCount = 0; 166 | 167 | // Start of ray-casting 168 | while (1) { 169 | 170 | traceCount++; 171 | 172 | // Vertical loop // an analogue for X-Ray 173 | while (!(ytilestep == -1 && YmapPos <= ytile) && !(ytilestep == 1 && YmapPos >= ytile)) { 174 | 175 | if (xtile < 0 || xtile >= 64 || YmapPos < 0 || YmapPos >= 64) { 176 | tracePoint.oob = true; 177 | return; 178 | } 179 | 180 | if (traceCheck(tileMap, doorMap, visibleTiles, xtile, YmapPos, yintercept % TILEGLOBAL, ystep, true, (xtilestep == -1), tracePoint)) { 181 | if (xstep < 0) { 182 | tracePoint.frac = 1 - tracePoint.frac; 183 | } 184 | return; 185 | } 186 | 187 | // prepare for next step 188 | xtile += xtilestep; 189 | yintercept += ystep; 190 | YmapPos = yintercept >> TILESHIFT; 191 | } 192 | 193 | // Horizontal loop // an analogue for Y-Ray 194 | while (!(xtilestep == -1 && XmapPos <= xtile) && !(xtilestep == 1 && XmapPos >= xtile)) { 195 | 196 | if (ytile < 0 || ytile >= 64 || XmapPos < 0 || XmapPos >= 64) { 197 | tracePoint.oob = true; 198 | return; 199 | } 200 | 201 | if (traceCheck(tileMap, doorMap, visibleTiles, XmapPos, ytile, xintercept % TILEGLOBAL, xstep, false, (ytilestep == -1), tracePoint)) { 202 | if (ystep > 0) { 203 | tracePoint.frac = 1 - tracePoint.frac; 204 | } 205 | return; 206 | } 207 | 208 | // prepare for next step 209 | ytile += ytilestep; 210 | xintercept += xstep; 211 | XmapPos = xintercept >> TILESHIFT; 212 | } 213 | 214 | if (traceCount > 1000) { 215 | return; 216 | } 217 | 218 | } // end of while( 1 ) 219 | 220 | 221 | } 222 | 223 | 224 | function traceRays(viewport, level) { 225 | var n, i, j, 226 | tileMap = level.tileMap, 227 | tracePoint, 228 | visibleTiles = [], 229 | numRays = Wolf.XRES / Wolf.SLICE_WIDTH, 230 | tracers = []; 231 | 232 | for (i=0;i<64;i++) { 233 | visibleTiles[i] = []; 234 | for (j=0;j<64;j++) { 235 | visibleTiles[i][j] = 0; 236 | } 237 | } 238 | 239 | // Ray casting 240 | 241 | for (n = 0 ; n < numRays ; ++n) { 242 | 243 | tracePoint = { 244 | x : viewport.x, 245 | y : viewport.y, 246 | angle : Wolf.Math.normalizeAngle(viewport.angle - Wolf.Math.ColumnAngle[n * Wolf.SLICE_WIDTH]), 247 | flags : Wolf.TRACE_SIGHT | Wolf.TRACE_MARK_MAP, 248 | oob : false 249 | }; 250 | 251 | trace(level, visibleTiles, tracePoint); 252 | 253 | tracers[n] = tracePoint; 254 | 255 | // Ugly hack to get rid of "blank slice" glitch due to out-of-bounds raycasting. 256 | // We simply re-use the previous slice if possible. 257 | if (tracePoint.oob) { 258 | if (n > 0 && !tracers[n-1].oob) { 259 | tracers[n] = tracers[n-1]; 260 | } 261 | } 262 | } 263 | 264 | return { 265 | visibleTiles : visibleTiles, 266 | tracers : tracers 267 | }; 268 | } 269 | 270 | 271 | return { 272 | traceRays : traceRays, 273 | trace : trace 274 | }; 275 | 276 | })(); 277 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | Wolfenstein 3D 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 |
23 | 24 | 111 | 112 |
113 | 114 | 115 |
116 |
117 | 118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 | 128 |
129 | 130 |
131 | 132 |
133 |
134 |
135 |
136 | 137 |
138 | 139 |
140 |
141 |
142 |
143 | 144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 | 153 |
154 |
155 |
156 |
157 |
158 |
159 | 160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 | 177 |
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 | 193 |
194 |
195 |
196 |
197 |
198 |
199 |
200 |
201 |
202 |
203 | 204 | 205 |
206 |
207 |
208 |
209 |
210 |
211 |
212 |
213 |
214 |
215 |
216 |
217 |
218 |
219 |
220 |
221 |
222 |
223 |
224 |
225 |
226 |
227 |
228 | 229 | 230 | 231 | -------------------------------------------------------------------------------- /js/input.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @namespace 3 | * @description Functions for capturing keyboard/mouse input 4 | */ 5 | Wolf.Input = (function() { 6 | 7 | var keys, 8 | lmbDown = false, 9 | rmbDown = false, 10 | bindings = [], 11 | hasFocus = false, 12 | mouseX = -1, mouseY = -1, 13 | mouseMoveX = 0, mouseMoveY = 0; 14 | 15 | function init() { 16 | var game = $("#game"), 17 | main = $("#main"), 18 | renderer = $("#game .renderer"); 19 | 20 | if (!keys) { 21 | keys = []; 22 | 23 | $(document) 24 | .on("keydown", function(e) { 25 | e.preventDefault(); 26 | 27 | if (!Wolf.Game.isPlaying()) { 28 | return; 29 | } 30 | 31 | keys[e.keyCode] = true; 32 | if (bindings[e.keyCode]) { 33 | for (var i=0,n=bindings[e.keyCode].length;i 1 || mouseY < 0 || mouseY > 1) { 183 | return null; 184 | } else { 185 | return { 186 | x : (mouseX - 0.5) * 2, 187 | y : (mouseY - 0.5) * 2 188 | }; 189 | } 190 | } 191 | 192 | function getMouseMovement() { 193 | var x = mouseMoveX, 194 | y = mouseMoveY; 195 | mouseMoveX = 0; 196 | mouseMoveY = 0; 197 | return { 198 | x : x / screen.width, 199 | y : y / screen.height 200 | }; 201 | } 202 | 203 | function getPointer() { 204 | var pointer = navigator.pointer || 205 | navigator.webkitPointer || 206 | navigator.mozPointer || 207 | navigator.msPointer || 208 | navigator.oPointer; 209 | return pointer; 210 | } 211 | 212 | function isPointerLocked() { 213 | var pointer = getPointer(); 214 | return pointer && pointer.isLocked && pointer.isLocked(); 215 | } 216 | 217 | function lockPointer() { 218 | var pointer = getPointer(); 219 | if (!pointer) { 220 | return; 221 | } 222 | 223 | if (Wolf.Game.isFullscreen()) { 224 | pointer.lock($("#game")[0], 225 | function(e) { 226 | Wolf.log("Pointer locked") 227 | }, function(e) { 228 | Wolf.log("Could not lock pointer: " + e); 229 | } 230 | ); 231 | } 232 | } 233 | 234 | function unlockPointer() { 235 | var pointer = getPointer(); 236 | if (!pointer) { 237 | return; 238 | } 239 | pointer.unlock($("#game")[0]); 240 | } 241 | 242 | 243 | return { 244 | init : init, 245 | reset : reset, 246 | resetMouse : resetMouse, 247 | checkKeys : checkKeys, 248 | clearKeys : clearKeys, 249 | bindKey : bindKey, 250 | leftMouseDown : leftMouseDown, 251 | rightMouseDown : rightMouseDown, 252 | getMouseCoords : getMouseCoords, 253 | getMouseMovement : getMouseMovement, 254 | isPointerLocked : isPointerLocked, 255 | lockPointer : lockPointer, 256 | unlockPointer : unlockPointer 257 | }; 258 | 259 | })(); 260 | 261 | 262 | Wolf.Keys = { 263 | LEFT : 37, 264 | UP : 38, 265 | RIGHT : 39, 266 | DOWN : 40, 267 | ENTER : 13, 268 | SPACE : 32, 269 | SHIFT : 16, 270 | CTRL : 17, 271 | ALT : 18, 272 | ESC : 27, 273 | HOME : 36, 274 | END : 35, 275 | DEL : 46, 276 | INS : 45, 277 | PGUP : 33, 278 | PGDN : 34, 279 | SLASH : 111, 280 | MINUS : 109, 281 | PLUS : 107, 282 | COMMA : 188, 283 | PERIOD : 190, 284 | 1 : 49, 285 | 2 : 50, 286 | 3 : 51, 287 | 4 : 52, 288 | 5 : 53, 289 | 6 : 54, 290 | 7 : 55, 291 | 8 : 56, 292 | 9 : 57, 293 | 0 : 58, 294 | A : 65, 295 | B : 66, 296 | C : 67, 297 | D : 68, 298 | E : 69, 299 | F : 70, 300 | G : 71, 301 | H : 72, 302 | I : 73, 303 | J : 74, 304 | K : 75, 305 | L : 76, 306 | M : 77, 307 | N : 78, 308 | O : 79, 309 | P : 80, 310 | Q : 81, 311 | R : 82, 312 | S : 83, 313 | T : 84, 314 | U : 85, 315 | V : 86, 316 | W : 87, 317 | X : 88, 318 | Y : 89, 319 | Z : 90, 320 | F1 : 112, 321 | F2 : 113, 322 | F3 : 114, 323 | F4 : 115, 324 | F5 : 116, 325 | F6 : 117, 326 | F7 : 118, 327 | F8 : 119, 328 | F9 : 120, 329 | F10 : 121, 330 | F11 : 122, 331 | F12 : 123 332 | }; -------------------------------------------------------------------------------- /js/powerups.js: -------------------------------------------------------------------------------- 1 | 2 | Wolf.Powerups = (function() { 3 | 4 | Wolf.setConsts({ 5 | pow_gibs : 0, // 1% if <=10%; SLURPIESND 6 | pow_gibs2 : 1, // 1% if <=10%; SLURPIESND 7 | pow_alpo : 2, // 4% if <100%; HEALTH1SND 8 | pow_firstaid : 3, // 25% if <100%; HEALTH2SND 9 | pow_key1 : 4, // gold key; GETKEYSND 10 | pow_key2 : 5, // silver key; GETKEYSND 11 | pow_key3 : 6, // not used 12 | pow_key4 : 7, // not used 13 | pow_cross : 8, // 100pts; BONUS1SND 14 | pow_chalice : 9, // 500pts; BONUS2SND 15 | pow_bible : 10, // 1000pts; BONUS3SND 16 | pow_crown : 11, // 5000pts; BONUS4SND 17 | pow_clip : 12, // 8bul if <99bul; GETAMMOSND 18 | pow_clip2 : 13, // 4bul if <99bul; GETAMMOSND 19 | pow_machinegun : 14, // machine gun; GETMACHINESND 20 | pow_chaingun : 15, // gatling gun; GETGATLINGSND 21 | pow_food : 16, // 10% if <100%; HEALTH1SND 22 | pow_fullheal : 17, // 99%, 25bul; BONUS1UPSND 23 | pow_25clip : 18, // 25bul if <99bul; GETAMMOBOXSND 24 | pow_spear : 19, // spear of destiny! 25 | pow_last : 20 26 | // add new types here (after last) 27 | }); 28 | 29 | var texture = [ 30 | Wolf.SPR_STAT_34, // pow_gibs 31 | Wolf.SPR_STAT_38, // pow_gibs2 32 | Wolf.SPR_STAT_6, // pow_alpo 33 | Wolf.SPR_STAT_25, // pow_firstaid 34 | Wolf.SPR_STAT_20, // pow_key1 35 | Wolf.SPR_STAT_21, // pow_key2 36 | // not used 37 | Wolf.SPR_STAT_20, // pow_key3 38 | Wolf.SPR_STAT_20, // pow_key4 39 | 40 | Wolf.SPR_STAT_29, // pow_cross 41 | Wolf.SPR_STAT_30, // pow_chalice 42 | Wolf.SPR_STAT_31, // pow_bible 43 | Wolf.SPR_STAT_32, // pow_crown 44 | Wolf.SPR_STAT_26, // pow_clip 45 | Wolf.SPR_STAT_26, // pow_clip2 46 | Wolf.SPR_STAT_27, // pow_machinegun 47 | Wolf.SPR_STAT_28, // pow_chaingun 48 | Wolf.SPR_STAT_24, // pow_food 49 | Wolf.SPR_STAT_33, // pow_fullheal 50 | // spear 51 | Wolf.SPR_STAT_49, // pow_25clip 52 | Wolf.SPR_STAT_51 // pow_spear 53 | ]; 54 | 55 | 56 | function remove(level, powerup) { 57 | powerup.x = -1; 58 | powerup.y = -1; 59 | } 60 | 61 | function addNew(level) { 62 | /* 63 | for (var i = 0;i < level.state.numPowerups; i++ ) { 64 | if (level.state.powerups[i].x == -1 ) { 65 | return level.state.powerups[i]; 66 | } 67 | } 68 | */ 69 | /* 70 | if (level.state.numPowerups == Wolf.MAX_POWERUPS ) { 71 | return level.state.powerups[0]; 72 | } 73 | */ 74 | level.state.numPowerups++; 75 | 76 | var newp = { 77 | x : -1, 78 | y : -1, 79 | type : 0, 80 | sprite : null 81 | }; 82 | 83 | level.state.powerups[level.state.numPowerups-1] = newp; 84 | 85 | return newp; 86 | } 87 | 88 | function reset(level) { 89 | level.state.numPowerups = 0; 90 | level.state.powerups = []; 91 | } 92 | 93 | // x,y are in TILES. 94 | function spawn(level, x, y, type) { 95 | var newp = addNew(level); 96 | 97 | newp.sprite = Wolf.Sprites.getNewSprite(level); 98 | newp.type = type; 99 | 100 | Wolf.Sprites.setPos(level, newp.sprite, Wolf.TILE2POS(newp.x = x), Wolf.TILE2POS(newp.y = y), 0); 101 | 102 | Wolf.Sprites.setTex(level, newp.sprite, -1, texture[type]); 103 | 104 | level.tileMap[x][y] |= Wolf.POWERUP_TILE; 105 | // good place to update total treasure count! 106 | } 107 | 108 | 109 | function give(level, player, type) { 110 | var keynames = ["Gold", "Silver", "?", "?"]; 111 | 112 | switch (type) { 113 | // Keys 114 | case Wolf.pow_key1: 115 | case Wolf.pow_key2: 116 | case Wolf.pow_key3: 117 | case Wolf.pow_key4: 118 | type -= Wolf.pow_key1; 119 | Wolf.Player.giveKey(player, type); 120 | Wolf.Sound.startSound(null, null, 0, Wolf.CHAN_ITEM, "lsfx/012.wav", 1, Wolf.ATTN_NORM, 0); 121 | Wolf.Game.notify(keynames[type] + " key"); 122 | break; 123 | // Treasure 124 | case Wolf.pow_cross: 125 | Wolf.Player.givePoints(player, 100); 126 | Wolf.Sound.startSound(null, null, 0, Wolf.CHAN_ITEM, "lsfx/035.wav", 1, Wolf.ATTN_NORM, 0); 127 | if ( ++level.state.foundTreasure == level.state.totalTreasure ) { 128 | Wolf.Game.notify("You found the last treasure!"); 129 | } 130 | break; 131 | 132 | case Wolf.pow_chalice: 133 | Wolf.Player.givePoints(player, 500); 134 | Wolf.Sound.startSound(null, null, 0, Wolf.CHAN_ITEM, "lsfx/036.wav", 1, Wolf.ATTN_NORM, 0); 135 | if (++level.state.foundTreasure == level.state.totalTreasure) { 136 | Wolf.Game.notify("You found the last treasure!"); 137 | } 138 | break; 139 | 140 | case Wolf.pow_bible: 141 | Wolf.Player.givePoints(player, 1000); 142 | Wolf.Sound.startSound(null, null, 0, Wolf.CHAN_ITEM, "lsfx/037.wav", 1, Wolf.ATTN_NORM, 0); 143 | if (++level.state.foundTreasure == level.state.totalTreasure) { 144 | Wolf.Game.notify("You found the last treasure!"); 145 | } 146 | break; 147 | 148 | case Wolf.pow_crown: 149 | Wolf.Player.givePoints(player, 5000); 150 | Wolf.Sound.startSound(null, null, 0, Wolf.CHAN_ITEM, "lsfx/045.wav", 1, Wolf.ATTN_NORM, 0); 151 | if (++level.state.foundTreasure == level.state.totalTreasure) { 152 | Wolf.Game.notify("You found the last treasure!"); 153 | } 154 | break; 155 | 156 | // Health 157 | case Wolf.pow_gibs: 158 | if (!Wolf.Player.giveHealth(player, 1, 11)) { 159 | return false; 160 | } 161 | Wolf.Sound.startSound(null, null, 0, Wolf.CHAN_ITEM, "lsfx/061.wav", 1, Wolf.ATTN_NORM, 0); 162 | break; 163 | 164 | case Wolf.pow_alpo: 165 | if (!Wolf.Player.giveHealth(player, 4, 0)) { 166 | return false; 167 | } 168 | Wolf.Sound.startSound(null, null, 0, Wolf.CHAN_ITEM, "lsfx/033.wav", 1, Wolf.ATTN_NORM, 0); 169 | break; 170 | 171 | case Wolf.pow_food: 172 | if (!Wolf.Player.giveHealth(player, 10, 0)) { 173 | return false; 174 | } 175 | Wolf.Sound.startSound(null, null, 0, Wolf.CHAN_ITEM, "lsfx/033.wav", 1, Wolf.ATTN_NORM, 0); 176 | break; 177 | 178 | case Wolf.pow_firstaid: 179 | if (!Wolf.Player.giveHealth(player, 25, 0)) { 180 | return false; 181 | } 182 | Wolf.Sound.startSound(null, null, 0, Wolf.CHAN_ITEM, "lsfx/034.wav", 1, Wolf.ATTN_NORM, 0); 183 | break; 184 | 185 | // Weapon & Ammo 186 | case Wolf.pow_clip: 187 | if (!Wolf.Player.giveAmmo(player, Wolf.AMMO_BULLETS, 8)) { 188 | return false; 189 | } 190 | Wolf.Sound.startSound(null, null, 0, Wolf.CHAN_ITEM, "lsfx/031.wav", 1, Wolf.ATTN_NORM, 0); 191 | break; 192 | 193 | case Wolf.pow_clip2: 194 | if (!Wolf.Player.giveAmmo(player, Wolf.AMMO_BULLETS, 4)) { 195 | return false; 196 | } 197 | Wolf.Sound.startSound(null, null, 0, Wolf.CHAN_ITEM, "lsfx/031.wav", 1, Wolf.ATTN_NORM, 0); 198 | break; 199 | 200 | case Wolf.pow_25clip: 201 | if (!Wolf.Player.giveAmmo(player, Wolf.AMMO_BULLETS, 25)) { 202 | return false; 203 | } 204 | Wolf.Sound.startSound(null, null, 0, Wolf.CHAN_ITEM, "lsfx/031.wav", 1, Wolf.ATTN_NORM, 0); 205 | break; 206 | 207 | case Wolf.pow_machinegun: 208 | Wolf.Player.giveWeapon(player, Wolf.WEAPON_AUTO ); 209 | Wolf.Sound.startSound(null, null, 0, Wolf.CHAN_ITEM, "lsfx/030.wav", 1, Wolf.ATTN_NORM, 0); 210 | Wolf.Game.notify("Machinegun"); 211 | break; 212 | 213 | case Wolf.pow_chaingun: 214 | Wolf.Player.giveWeapon(player, Wolf.WEAPON_CHAIN ); 215 | Wolf.Sound.startSound(null, null, 0, Wolf.CHAN_ITEM, "lsfx/038.wav", 1, Wolf.ATTN_NORM, 0); 216 | Wolf.Game.notify("Chaingun"); 217 | 218 | player.faceCount = -100; 219 | player.faceGotGun = true; 220 | break; 221 | 222 | // Artifacts 223 | case Wolf.pow_fullheal: 224 | // go to 150 health 225 | Wolf.Player.giveHealth(player, 99, 99 ); 226 | Wolf.Player.giveAmmo(player, Wolf.AMMO_BULLETS, 25 ); 227 | Wolf.Player.giveLife(player); 228 | if (++level.state.foundTreasure == level.state.totalTreasure) { 229 | Wolf.Game.notify("You found the last treasure!"); 230 | } else { 231 | Wolf.Game.notify("Full Heal"); 232 | } 233 | Wolf.Sound.startSound(null, null, 0, Wolf.CHAN_ITEM, "lsfx/034.wav", 1, Wolf.ATTN_NORM, 0); 234 | Wolf.log("Extra life!"); 235 | break; 236 | 237 | default: 238 | Wolf.log("Warning: Unknown item type: " + type); 239 | break; 240 | } 241 | 242 | Wolf.Game.startBonusFlash(); 243 | 244 | return true; 245 | } 246 | 247 | // x,y are in TILES. 248 | function pickUp(level, player, x, y) { 249 | var i, pow, 250 | p_left = false, 251 | p_pick = false; 252 | 253 | for (i=0; i>0; // infinity 78 | } else { 79 | TanTable[n] = Math.tan(angle); 80 | YnextTable[n] = (Wolf.FLOATTILE * Math.tan(angle))>>0; 81 | } 82 | 83 | if(n == Wolf.ANG_0 || n == Wolf.ANG_360) { 84 | XnextTable[n] = (Wolf.FLOATTILE / Math.tan(Wolf.FINE2RAD(n + 0.5)))>>0; // infinity 85 | } else if (n == Wolf.ANG_180) { 86 | XnextTable[n] = (Wolf.FLOATTILE / Math.tan(Wolf.FINE2RAD(n - 0.5)))>>0; // -infinity 87 | } else if (n == Wolf.ANG_90 || n == Wolf.ANG_270) { 88 | XnextTable[n] = 0; 89 | } else { 90 | XnextTable[n] = (Wolf.FLOATTILE / Math.tan(angle))>>0; 91 | } 92 | } 93 | 94 | tanfov2 = (Math.tan(Wolf.DEG2RAD((calcFov(75, Wolf.XRES, Wolf.YRES) / 2.0)))) * (Wolf.XRES / Wolf.YRES); 95 | for (n = 0; n < Wolf.XRES; ++n) { 96 | tanval = tanfov2 * (-1.0 + 2.0 * n / (Wolf.XRES-1)); 97 | ColumnAngle[n] = Wolf.RAD2FINE(Math.atan(tanval)) >> 0; 98 | } 99 | 100 | Wolf.Random.init(1); // random number generators 101 | 102 | return 1; 103 | } 104 | 105 | 106 | /** 107 | * @description Calculate the field of view. 108 | * @memberOf Wolf.Math 109 | * @param {number} fovX Must be within 1 and 179 degrees. 110 | * @param {number} width Width of viewing area. 111 | * @param {number} height Height of viewing area. 112 | * @returns {number} The field of view in degrees. 113 | */ 114 | 115 | function calcFov(fovX, width, height) { 116 | if (fovX < 1 || fovX > 179) { 117 | throw Error("Bad fov: " + fovX ); 118 | } 119 | 120 | return Wolf.RAD2DEG(Math.atan(height / (width / Math.tan(fovX / 360 * Math.PI)))) * 2; 121 | } 122 | 123 | 124 | /** 125 | * @description Clips angle to [0..360] bounds. 126 | * @memberOf Wolf.Math 127 | * @param {number} alpha Angle in degrees. 128 | * @returns {number} Normalized angle. 129 | */ 130 | function normalizeAngle(alpha) { 131 | if (alpha > Wolf.ANG_360) { 132 | alpha %= Wolf.ANG_360; 133 | } 134 | if (alpha < Wolf.ANG_0) { 135 | alpha = Wolf.ANG_360 - (-alpha) % Wolf.ANG_360; 136 | } 137 | return alpha; 138 | } 139 | 140 | 141 | /** 142 | * @description Get quadrant. 143 | * @memberOf Wolf.Math 144 | * @param {number} angle Radian angle. 145 | * @returns {number} 146 | */ 147 | function getQuadrant(angle) { 148 | angle = Wolf.Angle.normalize(angle); 149 | 150 | if (angle < Math.PI / 2) { 151 | return q_first; 152 | } else if (angle < Math.PI) { 153 | return q_second; 154 | } else if (angle < 3 * Math.PI / 2) { 155 | return q_third; 156 | } else { 157 | return q_fourth; 158 | } 159 | } 160 | 161 | /** 162 | * @description Get 4 point direction. 163 | * @memberOf Wolf.Math 164 | * @param {number} angle Radian angle. 165 | * @returns {number} Directional point. 166 | */ 167 | function get4dir(angle) { 168 | angle = Wolf.Angle.normalize(angle + Math.PI / 4); 169 | 170 | if (angle < Math.PI / 2) { 171 | return dir4_east; 172 | } else if( angle < Math.PI ) { 173 | return dir4_north; 174 | } else if( angle < 3 * Math.PI / 2 ) { 175 | return dir4_west; 176 | } else { 177 | return dir4_south; 178 | } 179 | } 180 | 181 | /** 182 | * @description Get 8 point direction. 183 | * @memberOf Wolf.Math 184 | * @param {number} angle Radian angle. 185 | * @returns {number} Directional point. 186 | */ 187 | function get8dir(angle) { 188 | angle = Wolf.Angle.normalize(angle + Math.PI / 12); 189 | 190 | if ( angle <= (Math.PI / 4)) { 191 | return dir8_east; 192 | } else if (angle < (Math.PI / 2)) { 193 | return dir8_northeast; 194 | } else if (angle <= (3 * Math.PI / 4)) { 195 | return dir8_north; 196 | } else if (angle < Math.PI) { 197 | return dir8_northwest; 198 | } else if (angle <= (5 * Math.PI / 4)) { 199 | return dir8_west; 200 | } else if (angle < (3 * Math.PI / 2)) { 201 | return dir8_southwest; 202 | } else if (angle <= (7 * Math.PI / 4)) { 203 | return dir8_south; 204 | } else { 205 | return dir8_southeast; 206 | } 207 | } 208 | 209 | /** 210 | * @description calculates distance between a point (x, y) and a line. 211 | * @memberOf Wolf.Math 212 | * @param {number} x X coord of point 213 | * @param {number} y Y coord of point 214 | * @param {number} a Line angle in degrees 215 | * @returns {number} Distance 216 | */ 217 | function point2LineDist(x, y, a) { 218 | return Math.abs( (x * SinTable[a] - y * CosTable[a]) >> 0); 219 | } 220 | 221 | 222 | 223 | /** 224 | * @description Calculates line length to the point nearest to (poin). 225 | * @memberOf Wolf.Math 226 | * @param {number} x X coord of point 227 | * @param {number} y Y coord of point 228 | * @param {number} a Line angle in degrees 229 | * @returns {number} Distance 230 | */ 231 | function lineLen2Point( x, y, a) { 232 | return (x * CosTable[a] + y * SinTable[a]) >> 0; 233 | } 234 | 235 | 236 | /* 237 | point2 = {x,y} 238 | / | 239 | / | 240 | / | 241 | /a______|----------> x 242 | point1 = {x, y} 243 | */ 244 | /** 245 | * @description Returns angle in radians 246 | * @memberOf Wolf.Math 247 | * @param {number} x X coord of point 248 | * @param {number} y Y coord of point 249 | * @param {number} a Line angle in degrees 250 | * @returns {number} Distance 251 | */ 252 | function transformPoint(point1X, point1Y, point2X, point2Y) { 253 | var angle = Math.atan2(point1Y - point2Y, point1X - point2X); 254 | return Wolf.Angle.normalize(angle); 255 | } 256 | 257 | 258 | buildTables(); 259 | 260 | return { 261 | calcFov : calcFov, 262 | normalizeAngle : normalizeAngle, 263 | getQuadrant : getQuadrant, 264 | get4dir : get4dir, 265 | get8dir : get8dir, 266 | point2LineDist : point2LineDist, 267 | lineLen2Point : lineLen2Point, 268 | transformPoint : transformPoint, 269 | 270 | SinTable : SinTable, 271 | CosTable : CosTable, 272 | TanTable : TanTable, 273 | XnextTable : XnextTable, 274 | YnextTable : YnextTable, 275 | ColumnAngle : ColumnAngle, 276 | 277 | dir4_east : dir4_east, 278 | dir4_north : dir4_north, 279 | dir4_west : dir4_west, 280 | dir4_south : dir4_south, 281 | dir4_nodir : dir4_nodir, 282 | dir8_east : dir8_east, 283 | dir8_northeast : dir8_northeast, 284 | dir8_north : dir8_north, 285 | dir8_northwest : dir8_northwest, 286 | dir8_west : dir8_west, 287 | dir8_southwest : dir8_southwest, 288 | dir8_south : dir8_south, 289 | dir8_southeast : dir8_southeast, 290 | dir8_nodir : dir8_nodir, 291 | dx4dir : dx4dir, 292 | dy4dir : dy4dir, 293 | dx8dir : dx8dir, 294 | dy8dir : dy8dir, 295 | dir4angle : dir4angle, 296 | dir8angle : dir8angle, 297 | dir4to8 : dir4to8, 298 | opposite4 : opposite4, 299 | opposite8 : opposite8, 300 | diagonal : diagonal 301 | }; 302 | 303 | })(); -------------------------------------------------------------------------------- /js/modernizr.custom.js: -------------------------------------------------------------------------------- 1 | /* Modernizr 2.5.3 (Custom Build) | MIT & BSD 2 | * Build: http://www.modernizr.com/download/#-borderimage-borderradius-boxshadow-flexbox-hsla-multiplebgs-opacity-rgba-textshadow-cssanimations-csscolumns-generatedcontent-cssgradients-cssreflections-csstransforms-csstransforms3d-csstransitions-applicationcache-canvas-canvastext-draganddrop-hashchange-history-audio-video-indexeddb-input-inputtypes-localstorage-postmessage-sessionstorage-websockets-websqldatabase-webworkers-touch-webgl-shiv-mq-cssclasses-addtest-prefixed-teststyles-testprop-testallprops-hasevent-prefixes-domprefixes-fullscreen_api-gamepad-load 3 | */ 4 | ;window.Modernizr=function(a,b,c){function C(a){j.cssText=a}function D(a,b){return C(n.join(a+";")+(b||""))}function E(a,b){return typeof a===b}function F(a,b){return!!~(""+a).indexOf(b)}function G(a,b){for(var d in a)if(j[a[d]]!==c)return b=="pfx"?a[d]:!0;return!1}function H(a,b,d){for(var e in a){var f=b[a[e]];if(f!==c)return d===!1?a[e]:E(f,"function")?f.bind(d||b):f}return!1}function I(a,b,c){var d=a.charAt(0).toUpperCase()+a.substr(1),e=(a+" "+p.join(d+" ")+d).split(" ");return E(b,"string")||E(b,"undefined")?G(e,b):(e=(a+" "+q.join(d+" ")+d).split(" "),H(e,b,c))}function K(){e.input=function(c){for(var d=0,e=c.length;d",a,""].join(""),k.id=h,m.innerHTML+=f,m.appendChild(k),l||(m.style.background="",g.appendChild(m)),i=c(k,a),l?k.parentNode.removeChild(k):m.parentNode.removeChild(m),!!i},y=function(b){var c=a.matchMedia||a.msMatchMedia;if(c)return c(b).matches;var d;return x("@media "+b+" { #"+h+" { position: absolute; } }",function(b){d=(a.getComputedStyle?getComputedStyle(b,null):b.currentStyle)["position"]=="absolute"}),d},z=function(){function d(d,e){e=e||b.createElement(a[d]||"div"),d="on"+d;var f=d in e;return f||(e.setAttribute||(e=b.createElement("div")),e.setAttribute&&e.removeAttribute&&(e.setAttribute(d,""),f=E(e[d],"function"),E(e[d],"undefined")||(e[d]=c),e.removeAttribute(d))),e=null,f}var a={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return d}(),A={}.hasOwnProperty,B;!E(A,"undefined")&&!E(A.call,"undefined")?B=function(a,b){return A.call(a,b)}:B=function(a,b){return b in a&&E(a.constructor.prototype[b],"undefined")},Function.prototype.bind||(Function.prototype.bind=function(b){var c=this;if(typeof c!="function")throw new TypeError;var d=v.call(arguments,1),e=function(){if(this instanceof e){var a=function(){};a.prototype=c.prototype;var f=new a,g=c.apply(f,d.concat(v.call(arguments)));return Object(g)===g?g:f}return c.apply(b,d.concat(v.call(arguments)))};return e});var J=function(c,d){var f=c.join(""),g=d.length;x(f,function(c,d){var f=b.styleSheets[b.styleSheets.length-1],h=f?f.cssRules&&f.cssRules[0]?f.cssRules[0].cssText:f.cssText||"":"",i=c.childNodes,j={};while(g--)j[i[g].id]=i[g];e.touch="ontouchstart"in a||a.DocumentTouch&&b instanceof DocumentTouch||(j.touch&&j.touch.offsetTop)===9,e.csstransforms3d=(j.csstransforms3d&&j.csstransforms3d.offsetLeft)===9&&j.csstransforms3d.offsetHeight===3,e.generatedcontent=(j.generatedcontent&&j.generatedcontent.offsetHeight)>=1},g,d)}([,["@media (",n.join("touch-enabled),("),h,")","{#touch{top:9px;position:absolute}}"].join(""),["@media (",n.join("transform-3d),("),h,")","{#csstransforms3d{left:9px;position:absolute;height:3px;}}"].join(""),['#generatedcontent:after{content:"',l,'";visibility:hidden}'].join("")],[,"touch","csstransforms3d","generatedcontent"]);r.flexbox=function(){return I("flexOrder")},r.canvas=function(){var a=b.createElement("canvas");return!!a.getContext&&!!a.getContext("2d")},r.canvastext=function(){return!!e.canvas&&!!E(b.createElement("canvas").getContext("2d").fillText,"function")},r.webgl=function(){try{var d=b.createElement("canvas"),e;e=!(!a.WebGLRenderingContext||!d.getContext("experimental-webgl")&&!d.getContext("webgl")),d=c}catch(f){e=!1}return e},r.touch=function(){return e.touch},r.postmessage=function(){return!!a.postMessage},r.websqldatabase=function(){return!!a.openDatabase},r.indexedDB=function(){return!!I("indexedDB",a)},r.hashchange=function(){return z("hashchange",a)&&(b.documentMode===c||b.documentMode>7)},r.history=function(){return!!a.history&&!!history.pushState},r.draganddrop=function(){var a=b.createElement("div");return"draggable"in a||"ondragstart"in a&&"ondrop"in a},r.websockets=function(){for(var b=-1,c=p.length;++b",d.insertBefore(c.lastChild,d.firstChild)}function h(){var a=k.elements;return typeof a=="string"?a.split(" "):a}function i(a){var b={},c=a.createElement,e=a.createDocumentFragment,f=e();a.createElement=function(a){var e=(b[a]||(b[a]=c(a))).cloneNode();return k.shivMethods&&e.canHaveChildren&&!d.test(a)?f.appendChild(e):e},a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+h().join().replace(/\w+/g,function(a){return b[a]=c(a),f.createElement(a),'c("'+a+'")'})+");return n}")(k,f)}function j(a){var b;return a.documentShived?a:(k.shivCSS&&!e&&(b=!!g(a,"article,aside,details,figcaption,figure,footer,header,hgroup,nav,section{display:block}audio{display:none}canvas,video{display:inline-block;*display:inline;*zoom:1}[hidden]{display:none}audio[controls]{display:inline-block;*display:inline;*zoom:1}mark{background:#FF0;color:#000}")),f||(b=!i(a)),b&&(a.documentShived=b),a)}var c=a.html5||{},d=/^<|^(?:button|form|map|select|textarea)$/i,e,f;(function(){var a=b.createElement("a");a.innerHTML="",e="hidden"in a,f=a.childNodes.length==1||function(){try{b.createElement("a")}catch(a){return!0}var c=b.createDocumentFragment();return typeof c.cloneNode=="undefined"||typeof c.createDocumentFragment=="undefined"||typeof c.createElement=="undefined"}()})();var k={elements:c.elements||"abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video",shivCSS:c.shivCSS!==!1,shivMethods:c.shivMethods!==!1,type:"default",shivDocument:j};a.html5=k,j(b)}(this,b),e._version=d,e._prefixes=n,e._domPrefixes=q,e._cssomPrefixes=p,e.mq=y,e.hasEvent=z,e.testProp=function(a){return G([a])},e.testAllProps=I,e.testStyles=x,e.prefixed=function(a,b,c){return b?I(a,b,c):I(a,"pfx")},g.className=g.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(f?" js "+u.join(" "):""),e}(this,this.document),function(a,b,c){function d(a){return o.call(a)=="[object Function]"}function e(a){return typeof a=="string"}function f(){}function g(a){return!a||a=="loaded"||a=="complete"||a=="uninitialized"}function h(){var a=p.shift();q=1,a?a.t?m(function(){(a.t=="c"?B.injectCss:B.injectJs)(a.s,0,a.a,a.x,a.e,1)},0):(a(),h()):q=0}function i(a,c,d,e,f,i,j){function k(b){if(!o&&g(l.readyState)&&(u.r=o=1,!q&&h(),l.onload=l.onreadystatechange=null,b)){a!="img"&&m(function(){t.removeChild(l)},50);for(var d in y[c])y[c].hasOwnProperty(d)&&y[c][d].onload()}}var j=j||B.errorTimeout,l={},o=0,r=0,u={t:d,s:c,e:f,a:i,x:j};y[c]===1&&(r=1,y[c]=[],l=b.createElement(a)),a=="object"?l.data=c:(l.src=c,l.type=a),l.width=l.height="0",l.onerror=l.onload=l.onreadystatechange=function(){k.call(this,r)},p.splice(e,0,u),a!="img"&&(r||y[c]===2?(t.insertBefore(l,s?null:n),m(k,j)):y[c].push(l))}function j(a,b,c,d,f){return q=0,b=b||"j",e(a)?i(b=="c"?v:u,a,b,this.i++,c,d,f):(p.splice(this.i++,0,a),p.length==1&&h()),this}function k(){var a=B;return a.loader={load:j,i:0},a}var l=b.documentElement,m=a.setTimeout,n=b.getElementsByTagName("script")[0],o={}.toString,p=[],q=0,r="MozAppearance"in l.style,s=r&&!!b.createRange().compareNode,t=s?l:n.parentNode,l=a.opera&&o.call(a.opera)=="[object Opera]",l=!!b.attachEvent&&!l,u=r?"object":l?"script":"img",v=l?"script":u,w=Array.isArray||function(a){return o.call(a)=="[object Array]"},x=[],y={},z={timeout:function(a,b){return b.length&&(a.timeout=b[0]),a}},A,B;B=function(a){function b(a){var a=a.split("!"),b=x.length,c=a.pop(),d=a.length,c={url:c,origUrl:c,prefixes:a},e,f,g;for(f=0;f"); 62 | slice.css({ 63 | position : "absolute", 64 | width : Wolf.SLICE_WIDTH + "px", 65 | height : Wolf.YRES + "px", 66 | left : x + "px", 67 | top : 0, 68 | overflow : "hidden" 69 | }); 70 | slice.appendTo("#game .renderer"); 71 | 72 | image = useBackgroundImage ? $("
") : $(""); 73 | 74 | image.css({ 75 | position : "absolute", 76 | display : "block", 77 | top : 0, 78 | height : 0, 79 | width : Wolf.SLICE_WIDTH * Wolf.WALL_TEXTURE_WIDTH + "px", 80 | backgroundSize : "100% 100%" 81 | }); 82 | 83 | var sliceElement = slice[0]; 84 | sliceElement.texture = image[0]; 85 | sliceElement.appendChild(sliceElement.texture); 86 | slices.push(sliceElement); 87 | } 88 | } 89 | 90 | function reset() { 91 | $("#game .renderer .sprite").remove(); 92 | sprites = []; 93 | visibleSprites = []; 94 | } 95 | 96 | function processTrace(viewport, tracePoint) { 97 | var x = tracePoint.x, 98 | y = tracePoint.y, 99 | vx = viewport.x, 100 | vy = viewport.y, 101 | 102 | dx = viewport.x - tracePoint.x, 103 | dy = viewport.y - tracePoint.y, 104 | dist = Math.sqrt(dx*dx + dy*dy), 105 | frac, 106 | h, w, offset; 107 | 108 | // correct for fisheye 109 | dist = dist * cos(FINE2RAD(tracePoint.angle - viewport.angle)); 110 | 111 | w = WALL_TEXTURE_WIDTH * SLICE_WIDTH; 112 | h = (VIEW_DIST / dist * TILEGLOBAL) >> 0; 113 | 114 | if (tracePoint.flags & TRACE_HIT_DOOR) { 115 | if (tracePoint.flags & TRACE_HIT_VERT) { 116 | if (x < vx) { 117 | frac = tracePoint.frac; 118 | } else { 119 | frac = 1 - tracePoint.frac; 120 | } 121 | } else { 122 | if (y < vy) { 123 | frac = 1 - tracePoint.frac; 124 | } else { 125 | frac = tracePoint.frac; 126 | } 127 | } 128 | } else { 129 | frac = 1 - tracePoint.frac; 130 | } 131 | 132 | offset = frac * w; 133 | if (offset > w - SLICE_WIDTH) { 134 | offset = w - SLICE_WIDTH; 135 | } 136 | offset = round(offset / SLICE_WIDTH) * SLICE_WIDTH; 137 | if (offset < 0) { 138 | offset = 0; 139 | } 140 | 141 | return { 142 | w : w, 143 | h : h, 144 | dist : dist, 145 | vert : tracePoint.flags & TRACE_HIT_VERT, 146 | offset : offset 147 | }; 148 | } 149 | 150 | function clear() { 151 | var n, sprite; 152 | for (n=0;n> 0, 183 | height = proc.h, 184 | z = (maxDistZ - proc.dist) >> 0, 185 | itop; 186 | 187 | if (Wolf.ISXP && Wolf.ISFIREFOX) { 188 | itop = (proc.texture % 2) ? 0 : -height; 189 | } else { 190 | itop = -(proc.texture-1) * height; 191 | textureSrc = "art/walls-shaded/64/walls.png"; 192 | } 193 | 194 | if (image._src != textureSrc) { 195 | image._src = textureSrc; 196 | if (useBackgroundImage) { 197 | imgStyle.backgroundImage = "url(" + textureSrc + ")"; 198 | } else { 199 | image.src = textureSrc; 200 | } 201 | } 202 | 203 | if (slice._zIndex != z) { 204 | sliceStyle.zIndex = slice._zIndex = z; 205 | } 206 | if (image._height != height) { 207 | sliceStyle.height = (image._height = height) + "px"; 208 | if (Wolf.ISXP && Wolf.ISFIREFOX) { 209 | imgStyle.height = (height * 2) + "px"; 210 | } else { 211 | imgStyle.height = (height * 120) + "px"; 212 | } 213 | } 214 | 215 | if (image._itop != itop) { 216 | imgStyle.top = (image._itop = itop) + "px"; 217 | } 218 | 219 | if (image._top != top) { 220 | sliceStyle.top = (image._top = top) + "px"; 221 | } 222 | if (image._left != left) { 223 | imgStyle.left = (image._left = left) + "px"; 224 | } 225 | } 226 | 227 | function drawWall(n, viewport, tracePoint, level) { 228 | var x = tracePoint.tileX, 229 | y = tracePoint.tileY, 230 | vx = POS2TILE(viewport.x), 231 | vy = POS2TILE(viewport.y), 232 | tileMap = level.tileMap, 233 | proc = processTrace(viewport, tracePoint), 234 | texture = proc.vert ? level.wallTexX[x][y] : level.wallTexY[x][y], 235 | textureSrc; 236 | 237 | 238 | // door sides 239 | if (tracePoint.flags & TRACE_HIT_VERT) { 240 | if (x >= vx && tileMap[x-1][y] & DOOR_TILE) { 241 | texture = TEX_PLATE; 242 | } 243 | if (x < vx && tileMap[x+1][y] & DOOR_TILE) { 244 | texture = TEX_PLATE; 245 | } 246 | } else { 247 | if (y >= vy && tileMap[x][y-1] & DOOR_TILE) { 248 | texture = TEX_PLATE; 249 | } 250 | if (y < vy && tileMap[x][y+1] & DOOR_TILE) { 251 | texture = TEX_PLATE; 252 | } 253 | } 254 | 255 | texture++; 256 | 257 | proc.texture = texture; 258 | 259 | if (texture % 2 == 0) { 260 | texture--; 261 | } 262 | textureSrc = texturePath + "w_" + texture + ".png"; 263 | 264 | updateSlice(n, textureSrc, proc); 265 | } 266 | 267 | function drawDoor(n, viewport, tracePoint, level) { 268 | var proc = processTrace(viewport, tracePoint), 269 | texture, textureSrc; 270 | 271 | //texture = Wolf.TEX_DDOOR + 1; 272 | texture = level.state.doorMap[tracePoint.tileX][tracePoint.tileY].texture + 1; 273 | 274 | proc.texture = texture; 275 | 276 | if (texture % 2 == 0) { 277 | texture -= 1; 278 | } 279 | 280 | textureSrc = texturePath + "w_" + texture + ".png"; 281 | 282 | updateSlice(n, textureSrc, proc); 283 | } 284 | 285 | function drawSprites(viewport, level, visibleTiles) { 286 | var vis, n, 287 | dist, dx, dy, angle, 288 | z, width, size, 289 | div, image, 290 | divStyle, imgStyle; 291 | 292 | 293 | // build visible sprites list 294 | visibleSprites = Wolf.Sprites.createVisList(viewport, level, visibleTiles); 295 | 296 | for (n = 0; n < visibleSprites.length; ++n ){ 297 | vis = visibleSprites[n]; 298 | dist = vis.dist; 299 | 300 | if (dist < MINDIST / 2 ) { 301 | //continue; // little hack to save speed & z-buffer 302 | } 303 | 304 | // make sure sprite is loaded 305 | if (!vis.sprite.div) { 306 | loadSprite(vis.sprite) 307 | } 308 | 309 | div = vis.sprite.div; 310 | divStyle = div.style; 311 | 312 | image = div.image; 313 | imgStyle = image.style; 314 | 315 | dx = vis.sprite.x - viewport.x; 316 | dy = vis.sprite.y - viewport.y; 317 | angle = atan2(dy, dx) - FINE2RAD(viewport.angle); 318 | 319 | //dist = dist * Math.cos(angle); 320 | 321 | size = (VIEW_DIST / dist * TILEGLOBAL) >> 0; 322 | 323 | divStyle.display = "block"; 324 | divStyle.width = size + "px"; 325 | divStyle.height = size + "px"; 326 | 327 | divStyle.left = (XRES / 2 - size / 2 - tan(angle) * VIEW_DIST) + "px"; 328 | 329 | divStyle.top = (YRES / 2 - size / 2) + "px"; 330 | 331 | texture = Wolf.Sprites.getTexture(vis.sprite.tex[0]); 332 | textureSrc = spritePath + texture.sheet; 333 | 334 | if (image._src != textureSrc) { 335 | image._src = textureSrc; 336 | if (useBackgroundImage) { 337 | imgStyle.backgroundImage = "url(" + textureSrc + ")"; 338 | } else { 339 | image.src = textureSrc; 340 | } 341 | } 342 | 343 | z = (maxDistZ - dist) >> 0; 344 | width = texture.num * size; 345 | left = -texture.idx * size; 346 | 347 | if (div._zIndex != z) { 348 | divStyle.zIndex = div._zIndex = z; 349 | } 350 | if (image._width != width) { 351 | imgStyle.width = (image._width = width) + "px"; 352 | } 353 | if (image._height != size) { 354 | imgStyle.height = (image._height = size) + "px"; 355 | } 356 | if (image._left != left) { 357 | imgStyle.left = (image._left = left) + "px"; 358 | } 359 | } 360 | } 361 | 362 | function unloadSprite(sprite) { 363 | if (sprite.div) { 364 | $(sprite.div).remove(); 365 | sprite.div = null; 366 | } 367 | } 368 | 369 | function loadSprite(sprite) { 370 | var div = document.createElement("div"), 371 | image; 372 | 373 | div.style.display = "none"; 374 | div.style.position = "absolute"; 375 | div.style.width = "128px"; 376 | div.style.height = "128px"; 377 | div.style.overflow = "hidden"; 378 | div.className = "sprite"; 379 | 380 | image = useBackgroundImage ? $("
") : $(""); 381 | 382 | image.css({ 383 | position : "absolute", 384 | display : "block", 385 | top : 0, 386 | height : "100%", 387 | width : "100%", 388 | backgroundSize : "100%", 389 | backgroundRepeat : "no-repeat" 390 | }); 391 | 392 | div.image = image[0]; 393 | div.appendChild(div.image); 394 | 395 | sprite.div = div; 396 | $("#game .renderer").append(div); 397 | } 398 | 399 | return { 400 | init : init, 401 | draw : draw, 402 | clear : clear, 403 | loadSprite : loadSprite, 404 | unloadSprite : unloadSprite, 405 | reset : reset 406 | }; 407 | 408 | })(); 409 | -------------------------------------------------------------------------------- /js/doors.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @namespace 3 | * @description Door management 4 | */ 5 | Wolf.Doors = (function() { 6 | 7 | Wolf.setConsts({ 8 | CLOSEWALL : Wolf.MINDIST, // Space between wall & player 9 | MAXDOORS : 64, // max number of sliding doors 10 | 11 | MAX_DOORS : 256, // jseidelin: doesn't look like this is used? 12 | DOOR_TIMEOUT : 300, 13 | DOOR_MINOPEN : 50, 14 | DOOR_FULLOPEN : 63, 15 | DOOR_VERT : 255, 16 | DOOR_HORIZ : 254, 17 | DOOR_E_VERT : 253, 18 | DOOR_E_HORIZ : 252, 19 | DOOR_G_VERT : 251, 20 | DOOR_G_HORIZ : 250, 21 | DOOR_S_VERT : 249, 22 | DOOR_S_HORIZ : 248, 23 | FIRST_DOOR : 248, 24 | LAST_LOCK : 251, 25 | 26 | TEX_DOOR : 98, 27 | // TEX_DOOR : 126, 28 | 29 | dr_closing : -1, 30 | dr_closed : 0, 31 | dr_opening : 1, 32 | dr_open : 2 33 | }); 34 | Wolf.setConsts({ 35 | // texture IDs used by cache routines 36 | TEX_DDOOR : (0 + Wolf.TEX_DOOR), // Simple Door 37 | TEX_PLATE : (2 + Wolf.TEX_DOOR), // Door Plate 38 | TEX_DELEV : (4 + Wolf.TEX_DOOR), // Elevator Door 39 | TEX_DLOCK : (6 + Wolf.TEX_DOOR) // Locked Door 40 | }); 41 | 42 | 43 | /** 44 | * @description Reset doors in the level 45 | * @memberOf Wolf.Doors 46 | * @param {object} level The level object. 47 | */ 48 | function reset(level) { 49 | level.state.numDoors = 0; 50 | 51 | for (var x=0;x<64;x++) { 52 | level.state.doorMap[x] = []; 53 | for (var y=0;y<64;y++) { 54 | level.state.doorMap[x][y] = 0; 55 | } 56 | } 57 | } 58 | 59 | /** 60 | * @description Spawn a door at the specified position. 61 | * @memberOf Wolf.Doors 62 | * @param {object} level The level object. 63 | * @param {number} x The x coordinate. 64 | * @param {number} y The y coordinate. 65 | * @param {number} type The door type. 66 | * @returns {number} The index of the new door. 67 | */ 68 | function spawn(level, x, y, type) { 69 | if (level.state.numDoors >= Wolf.MAXDOORS) { 70 | throw new Error("Too many Doors on level!"); 71 | } 72 | var door = level.state.doorMap[x][y] = { 73 | type : -1, 74 | vertical : 0, 75 | texture : -1, 76 | ticcount : 0 77 | }; 78 | 79 | switch(type) { 80 | case 0x5A: 81 | door.type = Wolf.DOOR_VERT; 82 | door.vertical = true; 83 | door.texture = Wolf.TEX_DDOOR + 1; 84 | break; 85 | case 0x5B: 86 | door.type = Wolf.DOOR_HORIZ; 87 | door.vertical = false; 88 | door.texture = Wolf.TEX_DDOOR; 89 | break; 90 | case 0x5C: 91 | door.type = Wolf.DOOR_G_VERT; 92 | door.vertical = true; 93 | door.texture = Wolf.TEX_DLOCK; 94 | break; 95 | case 0x5D: 96 | door.type = Wolf.DOOR_G_HORIZ; 97 | door.vertical = false; 98 | door.texture = Wolf.TEX_DLOCK; 99 | break; 100 | case 0x5E: 101 | door.type = Wolf.DOOR_S_VERT; 102 | door.vertical = true; 103 | door.texture = Wolf.TEX_DLOCK + 1; 104 | break; 105 | case 0x5F: 106 | door.type = Wolf.DOOR_S_HORIZ; 107 | door.vertical = false; 108 | door.texture = Wolf.TEX_DLOCK + 1; 109 | break; 110 | case 0x64: 111 | door.type = Wolf.DOOR_E_VERT; 112 | door.vertical = true; 113 | door.texture = Wolf.TEX_DELEV + 1; 114 | break; 115 | case 0x65: 116 | door.type = Wolf.DOOR_E_HORIZ; 117 | door.vertical = false; 118 | door.texture = Wolf.TEX_DELEV; 119 | break; 120 | default: 121 | throw new Error("Unknown door type: " + type); 122 | } 123 | 124 | door.tile = { 125 | x : x, 126 | y : y 127 | }; 128 | door.action = Wolf.dr_closed; 129 | 130 | level.state.doors[level.state.numDoors] = door; 131 | level.state.numDoors++; 132 | 133 | return level.state.numDoors - 1; 134 | } 135 | 136 | /** 137 | * @description Check to see if a door is open. If there are no doors in tile assume a closed door! 138 | * @memberOf Wolf.Doors 139 | * @param {object} doors The door object. 140 | * @returns {number} DOOR_FULLOPEN if door is opened, 141 | 0 if door is closed, 142 | >0 = Wolf.DOOR_FULLOPEN) { // door fully opened! 173 | door.action = Wolf.dr_open; 174 | door.ticcount = 0; 175 | } else { // opening! 176 | if (door.ticcount == 0) { 177 | // door is just starting to open, so connect the areas 178 | Wolf.Areas.join(level, door.area1, door.area2); 179 | Wolf.Areas.connect(level, player.areanumber); 180 | 181 | if (level.state.areabyplayer[door.area1]) { // Door Opening sound! 182 | Wolf.Sound.startSound(player.position, doorPos, 1, Wolf.CHAN_AUTO, "sfx/010.wav", 1, Wolf.ATTN_STATIC, 0); 183 | } 184 | } 185 | 186 | door.ticcount += tics; 187 | 188 | if (door.ticcount > Wolf.DOOR_FULLOPEN) { 189 | door.ticcount = Wolf.DOOR_FULLOPEN; 190 | } 191 | } 192 | break; 193 | 194 | case Wolf.dr_closing: 195 | if (door.ticcount <= 0) { // door fully closed! disconnect areas! 196 | Wolf.Areas.disconnect(level, door.area1, door.area2); 197 | Wolf.Areas.connect(level, player.areanumber); 198 | door.ticcount = 0; 199 | door.action = Wolf.dr_closed; 200 | } else { // closing! 201 | if (door.ticcount == Wolf.DOOR_FULLOPEN) { 202 | if (level.state.areabyplayer[door.area1]) { // Door Closing sound! 203 | Wolf.Sound.startSound(player.position, doorPos, 1, Wolf.CHAN_AUTO, "sfx/007.wav", 1, Wolf.ATTN_STATIC, 0); 204 | } 205 | } 206 | door.ticcount -= tics; 207 | if (door.ticcount < 0) { 208 | door.ticcount = 0; 209 | } 210 | } 211 | break; 212 | 213 | case Wolf.dr_open: 214 | if (door.ticcount > Wolf.DOOR_MINOPEN) { 215 | // If player or something is in door do not close it! 216 | if (!canCloseDoor(level, player, door.tile.x, door.tile.y, door.vertical)) { 217 | door.ticcount = Wolf.DOOR_MINOPEN; // do not close door immediately! 218 | } 219 | } 220 | if (door.ticcount >= Wolf.DOOR_TIMEOUT) { 221 | // Door timeout, time to close it! 222 | door.action = Wolf.dr_closing; 223 | door.ticcount = Wolf.DOOR_FULLOPEN; 224 | } else { 225 | // Increase timeout! 226 | door.ticcount += tics; 227 | } 228 | break; 229 | } // End switch lvldoors->Doors[ n ].action 230 | } // End for n = 0 ; n < lvldoors->numDoors ; ++n 231 | } 232 | 233 | /** 234 | * @description Set the areas doors in a level 235 | * @memberOf Wolf.Doors 236 | * @param {object} level The level object. 237 | * @param {array} areas The areas map. 238 | */ 239 | function setAreas(level) { 240 | var n, x, y, 241 | door; 242 | for (n=0; n= 0 ? level.areas[x + 1][y] : 0; 249 | door.area2 = level.areas[x - 1][y] >= 0 ? level.areas[x - 1][y] : 0; 250 | } else { 251 | door.area1 = level.areas[x][y + 1] >= 0 ? level.areas[x][y + 1] : 0; 252 | door.area2 = level.areas[x][y - 1] >= 0 ? level.areas[x][y - 1] : 0; 253 | } 254 | } 255 | } 256 | 257 | 258 | /** 259 | * @description Open a door 260 | * @memberOf Wolf.Doors 261 | * @param {object} doors The door object. 262 | */ 263 | function open(door) { 264 | if (door.action == Wolf.dr_open) { 265 | door.ticcount = 0; // reset opened time 266 | } else { 267 | door.action = Wolf.dr_opening; // start opening it 268 | } 269 | } 270 | 271 | /** 272 | * @description Change the state of a door 273 | * @private 274 | * @param {object} level The level object. 275 | * @param {object} player The player object. 276 | * @param {object} doors The door object. 277 | */ 278 | function changeDoorState(level, player, door) { 279 | if (door.action < Wolf.dr_opening ) { 280 | open(door); 281 | } else if (door.action == Wolf.dr_open && canCloseDoor(level, player, door.tile.x, door.tile.y, door.vertical)) { 282 | // !@# for the iphone with automatic using, don't allow any door close actions 283 | // Door->action = dr_closing; 284 | // Door->ticcount = DOOR_FULLOPEN; 285 | } 286 | } 287 | 288 | 289 | function canCloseDoor(level, player, x, y, vert ) { 290 | var n, 291 | tileX = Wolf.POS2TILE(player.position.x), 292 | tileY = Wolf.POS2TILE(player.position.y), 293 | guard; 294 | 295 | if (tileX == x && tileY == y ) { 296 | return false; 297 | } 298 | 299 | if (vert) { 300 | if (tileY == y) { 301 | if (Wolf.POS2TILE(player.position.x + Wolf.CLOSEWALL) == x) { 302 | return false; 303 | } 304 | if (Wolf.POS2TILE(player.position.x - Wolf.CLOSEWALL) == x) { 305 | return false; 306 | } 307 | } 308 | 309 | for (n = 0; n