Changeset 130 for pycodeshooter/trunk/shooter/bullet.js
- Timestamp:
- 05/02/12 20:56:24 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pycodeshooter/trunk/shooter/bullet.js
r115 r130 39 39 return (width < this.x || height < this.y || this.x < 0 || this.y < 0); 40 40 }; 41 this.draw = function(ctx ) {41 this.draw = function(ctx, func) { 42 42 if (this.frame) { 43 43 var pos = this.calcNext(); … … 61 61 62 62 ctx.beginPath(); 63 ctx.fillStyle = this.getColor(); 64 ctx.arc(this.x, this.y, this.getSize(), 0, Math.PI * 2.0, true); 65 ctx.fill(); 63 if (func) { 64 func(this, ctx); 65 } 66 else { 67 ctx.fillStyle = this.getColor(); 68 ctx.arc(this.x, this.y, this.getSize(), 0, Math.PI * 2.0, true); 69 ctx.fill(); 70 } 66 71 ctx.closePath(); 67 72 };
Note: See TracChangeset
for help on using the changeset viewer.