Changeset 109 for pycodeshooter/trunk
- Timestamp:
- 01/18/12 00:01:24 (13 years ago)
- Location:
- pycodeshooter/trunk
- Files:
-
- 23 added
- 1 deleted
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
pycodeshooter/trunk/index.html
r108 r109 19 19 var player = { 20 20 "name": document.getElementById("name").value, 21 "image": document.getElementById("p_img0"), 21 22 "size": parseInt(document.getElementById("size").value), 22 23 "hitsize": parseInt(document.getElementById("hitsize").value), … … 60 61 clearInterval(titleIntervalId); 61 62 titleIntervalId = 0; 63 64 var imgs = document.getElementsByTagName("img"); 65 for (var i = 0; i < imgs.length; i++) { 66 if (imgs[i].getAttribute("id").match(/^e_img/)) { 67 addEnemyImage(imgs[i]); 68 } 69 } 70 62 71 startGame(); 63 72 } 73 64 74 addEnemy(list[this[this.selectedIndex].value]); 65 75 }; … … 116 126 <br /> 117 127 <canvas id="screen" width="320" height="480"></canvas> 118 <input type="hidden" value=" 7"id="size" />128 <input type="hidden" value="20" id="size" /> 119 129 <input type="hidden" value="1" id="hitsize" /> 120 130 <input type="hidden" value="5" id="speed" /> … … 124 134 <input type="hidden" value="3" id="shotlevel" /> 125 135 <input type="hidden" value="/etc/pycodebattler/?mode=json" id="api" /> 126 <img src="logo.png" style="visibility: hidden;" id="logoimg" /> 136 <img src="images/logo.png" style="visibility: hidden;" id="logoimg" /> 137 138 <img src="images/ma1s.gif" style="visibility: hidden;" id="p_img0" /> 139 <img src="images/ma2s.gif" style="visibility: hidden;" id="p_img1" /> 140 <img src="images/ma5s.gif" style="visibility: hidden;" id="e_img0" /> 141 <img src="images/ma6s.gif" style="visibility: hidden;" id="e_img1" /> 142 <img src="images/ma7s.gif" style="visibility: hidden;" id="e_img2" /> 143 <img src="images/man1s.gif" style="visibility: hidden;" id="e_img3" /> 144 <img src="images/man2s.gif" style="visibility: hidden;" id="e_img4" /> 145 <img src="images/man3s.gif" style="visibility: hidden;" id="e_img5" /> 146 <img src="images/man4s.gif" style="visibility: hidden;" id="e_img6" /> 147 <img src="images/man5s.gif" style="visibility: hidden;" id="e_img7" /> 148 <img src="images/man6s.gif" style="visibility: hidden;" id="e_img8" /> 149 <img src="images/man7s.gif" style="visibility: hidden;" id="e_img9" /> 150 <img src="images/man8s.gif" style="visibility: hidden;" id="e_img10" /> 151 <img src="images/man9s.gif" style="visibility: hidden;" id="e_img11" /> 152 <img src="images/pin9s.gif" style="visibility: hidden;" id="e_img12" /> 153 <img src="images/so1s.gif" style="visibility: hidden;" id="e_img13" /> 154 <img src="images/so2s.gif" style="visibility: hidden;" id="e_img14" /> 155 <img src="images/so3s.gif" style="visibility: hidden;" id="e_img15" /> 156 <img src="images/so4s.gif" style="visibility: hidden;" id="e_img16" /> 157 <img src="images/so8s.gif" style="visibility: hidden;" id="e_img17" /> 158 <img src="images/so9s.gif" style="visibility: hidden;" id="e_img18" /> 127 159 </p> 128 160 </form> … … 185 217 <li><a href="http://trac.atzm.org/index.cgi/browser/pycodeshooter">pycodeshooter</a></li> 186 218 </ul> 219 220 <p>å©çšçŽ æç</p> 221 <ul style="font-size: small;"> 222 <li><a href="http://www.civillink.net/">ããªãŒçŽ æã®æ¥å€¢æ¥äºº</a></li> 223 </ul> 187 224 </div> 188 225 </div> -
pycodeshooter/trunk/shooter/system.js
r108 r109 22 22 }, 23 23 "message": null, 24 "enemyImages": new Array(), 24 25 "enemies": new Array(), 25 26 "players": new Array(), … … 194 195 } 195 196 197 function addEnemyImage(image) { 198 System.enemyImages.push(image); 199 } 200 196 201 function addEnemy(enemyData) { 197 202 var actList = EnemyActionLists[enemyData.mtime % EnemyActionLists.length]; … … 242 247 enemyData.name, 243 248 new actList(acts), 249 System.enemyImages[enemyData.hitpoint % System.enemyImages.length], 244 250 size, 245 251 size, … … 373 379 playerData.name, 374 380 new ActionList([new ManualAction(new ManualShot())]), 381 playerData.image, 375 382 playerData.size, 376 383 playerData.hitsize, -
pycodeshooter/trunk/shooter/trooper.js
r108 r109 71 71 }; 72 72 73 var Trooper = function(name, actList, size, hitSize, color, hitColor,73 var Trooper = function(name, actList, image, size, hitSize, color, hitColor, 74 74 x, y, w, h, life, speed, numBombs, bombColors, barrages) { 75 75 … … 78 78 this.name = name; 79 79 this.actList = actList; 80 this.image = image; 80 81 this.size = size; 81 82 this.hitSize = hitSize; … … 185 186 186 187 // draw trooper 187 ctx.beginPath(); 188 ctx.fillStyle = this.color; 189 ctx.arc(this.x, this.y, this.size, 0, Math.PI * 2.0, true); 190 ctx.fill(); 191 ctx.closePath(); 192 188 if (this.image) { 189 var w = this.image.width * (this.size / this.image.height); 190 var h = this.size; 191 var x = this.x - (w / 2); 192 var y = this.y - (h / 2); 193 ctx.drawImage(this.image, x, y, w, h); 194 } 195 else { 196 ctx.beginPath(); 197 ctx.fillStyle = this.color; 198 ctx.arc(this.x, this.y, this.size, 0, Math.PI * 2.0, true); 199 ctx.fill(); 200 ctx.closePath(); 201 } 202 203 // draw hit area 193 204 if (this.color != this.hitColor || this.size != this.hitSize) { 194 205 ctx.beginPath();
Note: See TracChangeset
for help on using the changeset viewer.