Changeset 97 for pycodeshooter/trunk
- Timestamp:
- 01/22/11 21:00:02 (14 years ago)
- Location:
- pycodeshooter/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
pycodeshooter/trunk/index.html
r95 r97 20 20 "name": document.getElementById("name").value, 21 21 "size": parseInt(document.getElementById("size").value), 22 "hitsize": parseInt(document.getElementById("hitsize").value), 22 23 "speed": parseInt(document.getElementById("speed").value), 23 24 "hitpoint": parseInt(document.getElementById("hitpoint").value), … … 114 115 <br /> 115 116 <canvas id="screen" width="320" height="480"></canvas> 116 <input type="hidden" value="5" id="size" /> 117 <input type="hidden" value="7" id="size" /> 118 <input type="hidden" value="1" id="hitsize" /> 117 119 <input type="hidden" value="5" id="speed" /> 118 120 <input type="hidden" value="7" id="shotsize" /> -
pycodeshooter/trunk/shooter/system.js
r96 r97 287 287 new ActionList([new ManualAction(new ManualShot())]), 288 288 playerData.size, 289 playerData.hitsize, 289 290 "#33F", 291 "#F33", 290 292 System.screen.width / 2, 291 293 System.screen.height - System.screen.height / 7, … … 369 371 new actList(acts), 370 372 Math.ceil(50 * (1 / bossData.defense)), 373 Math.ceil(50 * (1 / bossData.defense)), 374 "#F33", 371 375 "#F33", 372 376 System.screen.width / 2, -
pycodeshooter/trunk/shooter/trooper.js
r96 r97 67 67 }; 68 68 69 var Trooper = function(name, actList, size, color, x, y, w, h,70 life, speed, numBombs, barrages) {69 var Trooper = function(name, actList, size, hitSize, color, hitColor, 70 x, y, w, h, life, speed, numBombs, barrages) { 71 71 72 72 this.bullets = new Array(); … … 75 75 this.actList = actList; 76 76 this.size = size; 77 this.hitSize = hitSize; 77 78 this.color = color; 79 this.hitColor = hitColor; 78 80 this.x = x; 79 81 this.y = y; … … 141 143 delIdx = new Array(); 142 144 for (var i = 0; i < enemy.bullets.length; i++) { 143 if (touch(this.x, this.y, this. size,145 if (touch(this.x, this.y, this.hitSize, 144 146 enemy.bullets[i].x, enemy.bullets[i].y, enemy.bullets[i].size)) 145 147 delIdx.push(i); … … 164 166 ctx.closePath(); 165 167 168 if (this.color != this.hitColor || this.size != this.hitSize) { 169 ctx.beginPath(); 170 ctx.fillStyle = this.hitColor; 171 ctx.arc(this.x, this.y, this.hitSize, 0, Math.PI * 2.0, true); 172 ctx.fill(); 173 ctx.closePath(); 174 } 175 166 176 // draw bullets 167 177 for (var i = 0; i < this.bullets.length; i++)
Note: See TracChangeset
for help on using the changeset viewer.