Changeset 94 for pycodeshooter
- Timestamp:
- 01/13/11 01:28:52 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pycodeshooter/trunk/shooter/barrage.js
r91 r94 102 102 var CircularBarrage = function(bullet, size, color, 103 103 interval, speed, way, dir) { 104 if (way % 2) 105 way++; 104 106 105 107 var that = new ArchBarrage(bullet, size, color, … … 123 125 that.state = 0; 124 126 that.remain = that.way; 125 that.curAngle = 0;127 that.curAngle = null; 126 128 127 129 that.update = function(trooper, enemy) { … … 129 131 return false; 130 132 131 if ( !this.curAngle)133 if (this.curAngle == null) 132 134 this.curAngle = this.angle(trooper, enemy) - 133 this.delta * this.way / 2;135 this.delta * (this.way / 2); 134 136 135 137 trooper.addBullet(this.bullet, this.size, this.color, … … 147 149 this.state = 0; 148 150 this.remain = this.way; 149 this.curAngle = 0;151 this.curAngle = null; 150 152 return true; 151 153 }; … … 156 158 var DelayedCircularBarrage = function(bullet, size, color, 157 159 interval, speed, way, dir) { 160 if (way % 2) 161 way++; 158 162 159 163 var that = new DelayedArchBarrage(bullet, size, color, … … 182 186 this.state = 0; 183 187 this.remain = this.way; 184 this.curAngle = 0;188 this.curAngle = null; 185 189 this.i = 0; 186 190 return true; … … 208 212 this.state = 0; 209 213 this.remain = this.way; 210 this.curAngle = 0;214 this.curAngle = null; 211 215 this.i = 0; 212 216 return true;
Note: See TracChangeset
for help on using the changeset viewer.