Index: pycodeshooter/trunk/shooter/barrage.js
===================================================================
--- pycodeshooter/trunk/shooter/barrage.js	(revision 96)
+++ pycodeshooter/trunk/shooter/barrage.js	(revision 106)
@@ -14,8 +14,9 @@
  */
 
-var Barrage = function(bullet, size, color, interval, speed, way, dir) {
+var Barrage = function(bullet, size, color, frame, interval, speed, way, dir) {
     this.bullet   = bullet;
     this.size     = size;
     this.color    = color;
+    this.frame    = frame;
     this.interval = interval;
     this.speed    = speed;
@@ -44,6 +45,6 @@
 };
 
-var LinerBarrage = function(bullet, size, color, interval, speed, way, dir) {
-    var that = new Barrage(bullet, size, color, interval, speed, way, dir);
+var LinerBarrage = function(bullet, size, color, frame, interval, speed, way, dir) {
+    var that = new Barrage(bullet, size, color, frame, interval, speed, way, dir);
 
     that.state  = 0;
@@ -55,5 +56,5 @@
 
         trooper.addBullet(this.bullet, this.size, this.color,
-                          this.posX(), this.posY(),
+                          this.frame, this.posX(), this.posY(),
                           dir * Math.PI, this.speed);
 
@@ -62,8 +63,8 @@
 
             trooper.addBullet(this.bullet, this.size, this.color,
-                              this.posX(), this.posY(),
+                              this.frame, this.posX(), this.posY(),
                               (dir - d) * Math.PI, this.speed);
             trooper.addBullet(this.bullet, this.size, this.color,
-                              this.posX(), this.posY(),
+                              this.frame, this.posX(), this.posY(),
                               (dir + d) * Math.PI, this.speed);
         }
@@ -76,12 +77,12 @@
 };
 
-var ArchBarrage = function(bullet, size, color,
+var ArchBarrage = function(bullet, size, color, frame,
                            interval, speed, way, dir, delta) {
 
-    var that = new Barrage(bullet, size, color, interval, speed, way, dir);
+    var that = new Barrage(bullet, size, color, frame, interval, speed, way, dir);
 
     that.delta = delta;
 
-    if (that.way % 2)
+    if (!(that.way % 2))
         that.way++;
 
@@ -94,9 +95,9 @@
             return false;
 
-        var angle = this.angle(trooper, enemy) - (this.delta * this.way / 2);
+        var angle = this.angle(trooper, enemy) - (this.delta * (this.way - 1) / 2);
 
         for (var i = 0; i < this.way; i++) {
             trooper.addBullet(this.bullet, this.size, this.color,
-                              this.posX(), this.posY(),
+                              this.frame, this.posX(), this.posY(),
                               angle * Math.PI, this.speed);
             angle += this.delta;
@@ -110,22 +111,19 @@
 };
 
-var CircularBarrage = function(bullet, size, color,
+var CircularBarrage = function(bullet, size, color, frame,
                                interval, speed, way, dir) {
-    if (way % 2)
-        way++;
-
-    var that = new ArchBarrage(bullet, size, color,
+    var that = new ArchBarrage(bullet, size, color, frame,
                                interval, speed, way, dir, 2 / way);
     return that;
-}
-
-var DelayedArchBarrage = function(bullet, size, color,
+};
+
+var DelayedArchBarrage = function(bullet, size, color, frame,
                                   interval, speed, way, dir, delta) {
 
-    var that = new Barrage(bullet, size, color, interval, speed, way, dir);
+    var that = new Barrage(bullet, size, color, frame, interval, speed, way, dir);
 
     that.delta = delta;
 
-    if (that.way % 2)
+    if (!(that.way % 2))
         that.way++;
 
@@ -143,15 +141,15 @@
         if (this.curAngle == null)
             this.curAngle = this.angle(trooper, enemy) -
-                this.delta * (this.way / 2);
+                this.delta * (this.way - 1) / 2;
 
         trooper.addBullet(this.bullet, this.size, this.color,
-                          this.posX(), this.posY(),
+                          this.frame, this.posX(), this.posY(),
                           this.curAngle * Math.PI, this.speed);
-
-        this.curAngle += this.delta;
 
         if (--this.remain <= 0) {
             return this.reset();
         }
+
+        this.curAngle += this.delta;
 
         return false;
@@ -167,18 +165,15 @@
 };
 
-var DelayedCircularBarrage = function(bullet, size, color,
+var DelayedCircularBarrage = function(bullet, size, color, frame,
                                       interval, speed, way, dir) {
-    if (way % 2)
-        way++;
-
-    var that = new DelayedArchBarrage(bullet, size, color,
+    var that = new DelayedArchBarrage(bullet, size, color, frame,
                                       interval, speed, way, dir, 2 / way);
     return that;
 };
 
-var DelayedRecursiveArchBarrage = function(bullet, size, color,
+var DelayedRecursiveArchBarrage = function(bullet, size, color, frame,
                                            interval, speed, way, dir, cnt) {
 
-    var that = new DelayedArchBarrage(bullet, size, color,
+    var that = new DelayedArchBarrage(bullet, size, color, frame,
                                       interval, speed, way, dir);
 
@@ -204,8 +199,8 @@
 };
 
-var DelayedRecursiveCircularBarrage = function(bullet, size, color,
+var DelayedRecursiveCircularBarrage = function(bullet, size, color, frame,
                                                interval, speed, way, dir, cnt) {
 
-    var that = new DelayedCircularBarrage(bullet, size, color,
+    var that = new DelayedCircularBarrage(bullet, size, color, frame,
                                           interval, speed, way, dir);
 
@@ -230,9 +225,12 @@
 };
 
-var MultiRounderBarrage = function(bullet, size, color,
+var MultiRounderBarrage = function(bullet, size, color, frame,
                                    interval, speed, way, dir,
                                    klass, radius, num) {
+    if (way < 3)
+        way = 3;
+
     if (radius == null) {
-        radius = size * way;
+        radius = size * way * 3;
         if (radius > 50)
             radius = 50;
@@ -240,5 +238,5 @@
 
     if (num == null)
-        num = Math.ceil((1 / way) * 50);
+        num = Math.ceil((1 / way) * 5);
 
     var start = 0.25;
@@ -251,5 +249,5 @@
 
         for (var i = 0; i < num; i++) {
-            var b = new klass(bullet, size, color,
+            var b = new klass(bullet, size, color, frame,
                               interval, speed, w, dir);
 
@@ -286,43 +284,22 @@
 };
 
-var MultiRounderArchBarrage = function(bullet, size, color,
+var MultiRounderArchBarrage = function(bullet, size, color, frame,
                                        interval, speed, way, dir) {
-    var that = new MultiRounderBarrage(bullet, size, color, interval, speed,
-                                       way, dir, ArchBarrage);
-    return that;
-};
-
-var MultiRounderCircularBarrage = function(bullet, size, color,
-                                           interval, speed, way, dir) {
-    var that = new MultiRounderBarrage(bullet, size, color, interval, speed,
-                                       way, dir, CircularBarrage);
-    return that;
-};
-
-var MultiRounderDelayedArchBarrage = function(bullet, size, color,
+    var that = new MultiRounderBarrage(bullet, size, color, frame,
+                                       interval, speed, way, dir, ArchBarrage);
+    return that;
+};
+
+var MultiRounderDelayedArchBarrage = function(bullet, size, color, frame,
                                               interval, speed, way, dir) {
-    var that = new MultiRounderBarrage(bullet, size, color, interval, speed,
-                                       way, dir, DelayedArchBarrage);
-    return that;
-};
-
-var MultiRounderDelayedCircularBarrage = function(bullet, size, color,
-                                                  interval, speed, way, dir) {
-    var that = new MultiRounderBarrage(bullet, size, color, interval, speed,
-                                       way, dir, DelayedCircularBarrage);
-    return that;
-};
-
-var MultiRounderDelayedRecursiveArchBarrage = function(bullet, size, color,
+    var that = new MultiRounderBarrage(bullet, size, color, frame,
+                                       interval, speed, way, dir, DelayedArchBarrage);
+    return that;
+};
+
+var MultiRounderDelayedRecursiveArchBarrage = function(bullet, size, color, frame,
                                                        interval, speed, way, dir) {
-    var that = new MultiRounderBarrage(bullet, size, color, interval, speed,
-                                       way, dir, DelayedRecursiveArchBarrage);
-    return that;
-};
-
-var MultiRounderDelayedRecursiveCircularBarrage = function(bullet, size, color,
-                                                           interval, speed, way, dir) {
-    var that = new MultiRounderBarrage(bullet, size, color, interval, speed,
-                                       way, dir, DelayedRecursiveCircularBarrage);
+    var that = new MultiRounderBarrage(bullet, size, color, frame,
+                                       interval, speed, way, dir, DelayedRecursiveArchBarrage);
     return that;
 };
@@ -337,7 +314,4 @@
                      DelayedRecursiveCircularBarrage,
                      MultiRounderArchBarrage,
-                     MultiRounderCircularBarrage,
                      MultiRounderDelayedArchBarrage,
-                     MultiRounderDelayedCircularBarrage,
-                     MultiRounderDelayedRecursiveArchBarrage,
-                     MultiRounderDelayedRecursiveCircularBarrage];
+                     MultiRounderDelayedRecursiveArchBarrage]
