Changeset 94


Ignore:
Timestamp:
01/13/11 01:28:52 (13 years ago)
Author:
atzm
Message:

fixed trivial bug

File:
1 edited

Legend:

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

    r91 r94  
    102102var CircularBarrage = function(bullet, size, color, 
    103103                               interval, speed, way, dir) { 
     104    if (way % 2) 
     105        way++; 
    104106 
    105107    var that = new ArchBarrage(bullet, size, color, 
     
    123125    that.state    = 0; 
    124126    that.remain   = that.way; 
    125     that.curAngle = 0; 
     127    that.curAngle = null; 
    126128 
    127129    that.update = function(trooper, enemy) { 
     
    129131            return false; 
    130132 
    131         if (!this.curAngle) 
     133        if (this.curAngle == null) 
    132134            this.curAngle = this.angle(trooper, enemy) - 
    133                 this.delta * this.way / 2; 
     135                this.delta * (this.way / 2); 
    134136 
    135137        trooper.addBullet(this.bullet, this.size, this.color, 
     
    147149        this.state    = 0; 
    148150        this.remain   = this.way; 
    149         this.curAngle = 0; 
     151        this.curAngle = null; 
    150152        return true; 
    151153    }; 
     
    156158var DelayedCircularBarrage = function(bullet, size, color, 
    157159                                      interval, speed, way, dir) { 
     160    if (way % 2) 
     161        way++; 
    158162 
    159163    var that = new DelayedArchBarrage(bullet, size, color, 
     
    182186        this.state    = 0; 
    183187        this.remain   = this.way; 
    184         this.curAngle = 0; 
     188        this.curAngle = null; 
    185189        this.i        = 0; 
    186190        return true; 
     
    208212        this.state    = 0; 
    209213        this.remain   = this.way; 
    210         this.curAngle = 0; 
     214        this.curAngle = null; 
    211215        this.i        = 0; 
    212216        return true; 
Note: See TracChangeset for help on using the changeset viewer.