Changeset 103
- Timestamp:
- 01/23/11 00:58:06 (14 years ago)
- Location:
- pycodeshooter/trunk/shooter
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
pycodeshooter/trunk/shooter/action.js
r92 r103 238 238 this.p2[0] * p2 + this.p3[0] * p3, 239 239 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 241 242 ); 242 243 -
pycodeshooter/trunk/shooter/trooper.js
r98 r103 88 88 this.barrages = barrages; 89 89 90 this.move = function(x, y ) {90 this.move = function(x, y, area) { 91 91 this.x += x; 92 92 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) { 97 97 this.x = x; 98 98 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 103 106 if (this.x > this.w) 104 107 this.x = this.w; 105 108 106 if (this.y > this.h )107 this.y = this.h ;109 if (this.y > this.h / area) 110 this.y = this.h / area; 108 111 109 112 if (this.x < 0)
Note: See TracChangeset
for help on using the changeset viewer.