Changeset 103 for pycodeshooter


Ignore:
Timestamp:
01/23/11 00:58:06 (13 years ago)
Author:
atzm
Message:

chousei

Location:
pycodeshooter/trunk/shooter
Files:
2 edited

Legend:

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

    r92 r103  
    238238                this.p2[0] * p2 + this.p3[0] * p3, 
    239239            this.p0[1] * p0 + this.p1[1] * p1 + 
    240                 this.p2[1] * p2 + this.p3[1] * p3 
     240                this.p2[1] * p2 + this.p3[1] * p3, 
     241            3 
    241242        ); 
    242243 
  • pycodeshooter/trunk/shooter/trooper.js

    r98 r103  
    8888    this.barrages   = barrages; 
    8989 
    90     this.move = function(x, y) { 
     90    this.move = function(x, y, area) { 
    9191        this.x += x; 
    9292        this.y += y; 
    93         this.adjustPosition(); 
    94     }; 
    95  
    96     this.moveAbs = function(x, y) { 
     93        this.adjustPosition(area); 
     94    }; 
     95 
     96    this.moveAbs = function(x, y, area) { 
    9797        this.x = x; 
    9898        this.y = y; 
    99         this.adjustPosition(); 
    100     }; 
    101  
    102     this.adjustPosition = function() { 
     99        this.adjustPosition(area); 
     100    }; 
     101 
     102    this.adjustPosition = function(area) { 
     103        if (area == null) 
     104            area = 1; 
     105 
    103106        if (this.x > this.w) 
    104107            this.x = this.w; 
    105108 
    106         if (this.y > this.h) 
    107             this.y = this.h; 
     109        if (this.y > this.h / area) 
     110            this.y = this.h / area; 
    108111 
    109112        if (this.x < 0) 
Note: See TracChangeset for help on using the changeset viewer.