Changeset 115


Ignore:
Timestamp:
01/21/12 04:55:10 (13 years ago)
Author:
atzm
Message:

moromoro

File:
1 edited

Legend:

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

    r114 r115  
    8888 
    8989var 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; 
    9293 
    9394    that.calcNext = function() { 
     
    9596        var y = this.y + this.getDeltaY(); 
    9697 
    97         if ((0 >= x || x >= this.w) && count < 5) { 
    98             count++; 
     98        if ((0 >= x || x >= this.w) && this.reflectCount < 5) { 
     99            this.reflectCount++; 
    99100            this.dir += (2 - this.dir) - (this.dir - 1); 
    100101            this.deltaBaseX = Math.cos(this.dir); 
     
    214215 
    215216var 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; 
    218220 
    219221    that.getDir = function() { 
     
    221223        var y = this.y + Math.sin(this.dir) * this.i; 
    222224 
    223         if ((0 >= x || x >= this.w) && count < 5) { 
    224             count++; 
     225        if ((0 >= x || x >= this.w) && this.reflectCount < 5) { 
     226            this.reflectCount++; 
    225227            this.dir += (2 - this.dir) - (this.dir - 1); 
    226228        } 
     
    233235 
    234236var 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; 
    237240 
    238241    that.getDir = function() { 
     
    240243        var y = this.y + Math.sin(this.dir) * this.i; 
    241244 
    242         if ((0 >= x || x >= this.w) && count < 5) { 
    243             count++; 
     245        if ((0 >= x || x >= this.w) && this.reflectCount < 5) { 
     246            this.reflectCount++; 
    244247            this.dir += (2 - this.dir) - (this.dir - 1); 
    245248        } 
Note: See TracChangeset for help on using the changeset viewer.