Ignore:
Timestamp:
01/26/11 02:40:22 (13 years ago)
Author:
atzm
Message:
  • fixed small bug
  • add bullet frame
  • parameter adjust
File:
1 edited

Legend:

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

    r103 r106  
    163163            this.bomb.draw(ctx); 
    164164 
     165        // draw bullets 
     166        for (var i = 0; i < this.bullets.length; i++) 
     167            this.bullets[i].draw(ctx); 
     168 
    165169        // draw trooper 
    166170        ctx.beginPath(); 
     
    177181            ctx.closePath(); 
    178182        } 
    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) { 
    186186        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)); 
    188188    }; 
    189189 
Note: See TracChangeset for help on using the changeset viewer.