Changeset 106 for pycodeshooter/trunk/shooter/trooper.js
- Timestamp:
- 01/26/11 02:40:22 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pycodeshooter/trunk/shooter/trooper.js
r103 r106 163 163 this.bomb.draw(ctx); 164 164 165 // draw bullets 166 for (var i = 0; i < this.bullets.length; i++) 167 this.bullets[i].draw(ctx); 168 165 169 // draw trooper 166 170 ctx.beginPath(); … … 177 181 ctx.closePath(); 178 182 } 179 180 // draw bullets 181 for (var i = 0; i < this.bullets.length; i++) 182 this.bullets[i].draw(ctx); 183 }; 184 185 this.addBullet = function(bulletType, size, color, x, y, dir, speed) { 183 }; 184 185 this.addBullet = function(bulletType, size, color, frame, x, y, dir, speed) { 186 186 this.bullets.push( 187 new bulletType(size, color, this.x + x, this.y + y, dir, speed));187 new bulletType(size, color, frame, this.x + x, this.y + y, dir, speed)); 188 188 }; 189 189
Note: See TracChangeset
for help on using the changeset viewer.