Changeset 115 for pycodeshooter/trunk/shooter
- Timestamp:
- 01/21/12 04:55:10 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pycodeshooter/trunk/shooter/bullet.js
r114 r115 88 88 89 89 var XReflectLinerBullet = function(size, color, frame, w, h, x, y, dir, speed) { 90 var that = new LinerBullet(size, color, frame, w, h, x, y, dir, speed); 91 var count = 0; 90 var that = new LinerBullet(size, color, frame, w, h, x, y, dir, speed); 91 92 that.reflectCount = 0; 92 93 93 94 that.calcNext = function() { … … 95 96 var y = this.y + this.getDeltaY(); 96 97 97 if ((0 >= x || x >= this.w) && count < 5) {98 count++;98 if ((0 >= x || x >= this.w) && this.reflectCount < 5) { 99 this.reflectCount++; 99 100 this.dir += (2 - this.dir) - (this.dir - 1); 100 101 this.deltaBaseX = Math.cos(this.dir); … … 214 215 215 216 var XReflectLeftCurveBullet = function(size, color, frame, w, h, x, y, dir, speed) { 216 var that = new LeftCurveBullet(size, color, frame, w, h, x, y, dir, speed); 217 var count = 0; 217 var that = new LeftCurveBullet(size, color, frame, w, h, x, y, dir, speed); 218 219 that.reflectCount = 0; 218 220 219 221 that.getDir = function() { … … 221 223 var y = this.y + Math.sin(this.dir) * this.i; 222 224 223 if ((0 >= x || x >= this.w) && count < 5) {224 count++;225 if ((0 >= x || x >= this.w) && this.reflectCount < 5) { 226 this.reflectCount++; 225 227 this.dir += (2 - this.dir) - (this.dir - 1); 226 228 } … … 233 235 234 236 var XReflectRightCurveBullet = function(size, color, frame, w, h, x, y, dir, speed) { 235 var that = new RightCurveBullet(size, color, frame, w, h, x, y, dir, speed); 236 var count = 0; 237 var that = new RightCurveBullet(size, color, frame, w, h, x, y, dir, speed); 238 239 that.reflectCount = 0; 237 240 238 241 that.getDir = function() { … … 240 243 var y = this.y + Math.sin(this.dir) * this.i; 241 244 242 if ((0 >= x || x >= this.w) && count < 5) {243 count++;245 if ((0 >= x || x >= this.w) && this.reflectCount < 5) { 246 this.reflectCount++; 244 247 this.dir += (2 - this.dir) - (this.dir - 1); 245 248 }
Note: See TracChangeset
for help on using the changeset viewer.