Changeset 97 for pycodeshooter/trunk/shooter/trooper.js
- Timestamp:
- 01/22/11 21:00:02 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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.