Ignore:
Timestamp:
05/02/12 20:56:24 (12 years ago)
Author:
atzm
Message:
  • add power-up items
File:
1 edited

Legend:

Unmodified
Added
Removed
  • pycodeshooter/trunk/shooter/bullet.js

    r115 r130  
    3939        return (width < this.x || height < this.y || this.x < 0 || this.y < 0); 
    4040    }; 
    41     this.draw = function(ctx) { 
     41    this.draw = function(ctx, func) { 
    4242        if (this.frame) { 
    4343            var pos = this.calcNext(); 
     
    6161 
    6262        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        } 
    6671        ctx.closePath(); 
    6772    }; 
Note: See TracChangeset for help on using the changeset viewer.