Changeset 126 for pycodeshooter/trunk
- Timestamp:
- 01/22/12 21:00:46 (13 years ago)
- Location:
- pycodeshooter/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
pycodeshooter/trunk/index.html
r122 r126 67 67 drawString( 68 68 ctx, "source-over", 69 "C lick screen to start game",70 1 5, 20, "#ACF", "9pt monospace", "left"69 "CLICK SCREEN TO START GAME", 70 10, 20, "#ACF", "9pt monospace", "left" 71 71 ); 72 72 }, 20); … … 119 119 // auto enemy encounter 120 120 var enemyIntervalId = setInterval(function() { 121 if ( numEnemies() < parseInt(document.getElementById("numenemies").value)) {121 if (getEnemiesOnScreen() < getStageNumber()) { 122 122 var ids = Object.keys(enemyList); 123 123 var id = ids[Math.floor(Math.random() * ids.length)]; … … 148 148 <h3><span class="sanchor">â </span> ææŠãã!</h3> 149 149 <p> 150 åå: <input type="text" value="P layer" size="8" id="name" />150 åå: <input type="text" value="PLAYER" size="8" id="name" /> 151 151 èä¹ 152 152 æ§: <input type="text" value="5" size="3" id="hitpoint" /> 153 153 ãã æ°: <input type="text" value="2" size="3" id="numbombs" /> 154 é³ æ¥œ: <input type="checkbox" checked="checked" id="sound" />154 é³: <input type="checkbox" checked="checked" id="sound" /> 155 155 <br /> 156 156 <canvas id="screen" width="320" height="480"></canvas> … … 162 162 <input type="hidden" value="5" id="shotinterval" /> 163 163 <input type="hidden" value="3" id="shotlevel" /> 164 <input type="hidden" value="3" id="numenemies" />165 164 <input type="hidden" value="/etc/pycodebattler/?mode=json" id="api" /> 166 165 <img src="images/logo.png" style="visibility: hidden;" id="logoimg" /> -
pycodeshooter/trunk/shooter/system.js
r125 r126 208 208 } 209 209 210 function getStageNumber() { 211 return System.stage; 212 } 213 210 214 function switchStage(base) { 211 215 var scores = Object.keys(System.score); … … 266 270 } 267 271 268 function numEnemies() {272 function getEnemiesOnScreen() { 269 273 return System.enemies.length; 270 274 } … … 378 382 // switch stage 379 383 if (switchStage(50000)) 380 switchBgm(System.stage); 384 switchBgm(getStageNumber()); 385 386 // draw stage number 387 drawString( 388 System.screen.ctx, 389 "source-over", 390 "STAGE " + getStageNumber(), 391 System.screen.width - 10, 392 System.screen.height - 15, 393 "#ACF", "9pt monospace", "right" 394 ); 381 395 382 396 // draw score … … 387 401 System.screen.ctx, 388 402 "source-over", 389 name + " score" + System.score[name],403 name + " SCORE " + System.score[name], 390 404 (System.screen.width - 10), 391 405 i * 16 + 15,
Note: See TracChangeset
for help on using the changeset viewer.