Changeset 122 for pycodeshooter/trunk/index.html
- Timestamp:
- 01/22/12 19:47:14 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pycodeshooter/trunk/index.html
r119 r122 14 14 <script type="text/javascript"> 15 15 window.onload = function () { 16 // load enemies 16 17 var req = new XMLHttpRequest(); 17 18 req.open("GET", document.getElementById("api").value, false); … … 26 27 var enemyList = JSON.parse(req.responseText).result; 27 28 29 // system message clear 30 setMessage(msg, "<br />"); 31 32 // register sounds to system 28 33 registerSound("bgm_title", document.getElementById("bgm_title")); 29 34 registerSound("bgm_stage1", document.getElementById("bgm_stage1")); 35 registerSound("bgm_stage2", document.getElementById("bgm_stage2")); 36 registerSound("bgm_stage3", document.getElementById("bgm_stage3")); 37 registerSound("bgm_stage4", document.getElementById("bgm_stage4")); 38 registerSound("bgm_stage5", document.getElementById("bgm_stage5")); 30 39 registerSound("se_start", document.getElementById("se_start")); 31 40 registerSound("se_encounter", document.getElementById("se_encounter")); … … 34 43 registerSound("se_bomb", document.getElementById("se_bomb")); 35 44 registerSound("se_destroy", document.getElementById("se_destroy")); 36 setMessage(msg, "<br />"); 37 38 // sound on/off 45 46 // sound on/off (default off) 39 47 soundCheck.onclick = function() { 40 48 toggleSound(soundCheck.checked); 41 49 }; 42 50 soundCheck.click(); 51 playSound("bgm_title"); 43 52 44 53 // title screen set 45 var titlebgm = document.getElementById("bgm_title");46 54 var logoimg = document.getElementById("logoimg"); 47 55 var x = (screen.width - logoimg.width) / 2; … … 64 72 }, 20); 65 73 66 playSound("bgm_title");67 68 74 // start game 69 75 screen.onclick = function() { … … 72 78 } 73 79 74 titlebgm.pause(); 80 clearInterval(titleIntervalId); 81 titleIntervalId = 0; 82 83 pauseSound("bgm_title", true) 75 84 playSound("se_start"); 76 85 77 86 setTimeout(function() { 78 clearInterval(titleIntervalId);79 titleIntervalId = 0;80 81 87 var player = { 82 88 "name": document.getElementById("name").value, … … 109 115 } 110 116 111 document.onkeydown = function (ev) { setKeyDown(ev.keyCode); };112 document.onkeyup = function (ev) { setKeyUp(ev.keyCode); };113 document.onkeypress = function (ev) { setKeyPress(ev.charCode); };114 115 playSound("bgm_stage1");116 117 initGame(document.getElementById("screen"), msg, player); 117 118 119 // auto enemy encounter 118 120 var enemyIntervalId = setInterval(function() { 119 121 if (numEnemies() < parseInt(document.getElementById("numenemies").value)) { … … 124 126 } 125 127 }, 1500); 126 }, 1 400);128 }, 1500); 127 129 }; 128 130 }; … … 166 168 <audio src="sounds/bgm_sht_a01.mp3", id="bgm_title" loop="true" preload="auto" /> 167 169 <audio src="sounds/bgm_sht_a02.mp3", id="bgm_stage1" loop="true" preload="auto" /> 170 <audio src="sounds/bgm_sht_a03.mp3", id="bgm_stage2" loop="true" preload="auto" /> 171 <audio src="sounds/bgm_sht_a04.mp3", id="bgm_stage3" loop="true" preload="auto" /> 172 <audio src="sounds/bgm_sht_a05.mp3", id="bgm_stage4" loop="true" preload="auto" /> 173 <audio src="sounds/bgm_sht_a06.mp3", id="bgm_stage5" loop="true" preload="auto" /> 168 174 <audio src="sounds/se_coinin_1.mp3", id="se_start" preload="auto" /> 169 175 <audio src="sounds/se_denshion_1.mp3", id="se_encounter" preload="auto" />
Note: See TracChangeset
for help on using the changeset viewer.