Index: pycodeshooter/trunk/shooter/barrage.js
===================================================================
--- pycodeshooter/trunk/shooter/barrage.js	(revision 94)
+++ pycodeshooter/trunk/shooter/barrage.js	(revision 96)
@@ -36,4 +36,10 @@
         return false;
     };
+    this.posX = function() {
+        return 0;
+    };
+    this.posY = function() {
+        return 0;
+    };
 };
 
@@ -49,13 +55,16 @@
 
         trooper.addBullet(this.bullet, this.size, this.color,
-                          0, 0, dir * Math.PI, this.speed);
-
-        for (i = 2; i < this.way + 1; i++) {
+                          this.posX(), this.posY(),
+                          dir * Math.PI, this.speed);
+
+        for (var i = 2; i < this.way + 1; i++) {
             var d = 0.5 / i;
 
             trooper.addBullet(this.bullet, this.size, this.color,
-                              0, 0, (dir - d) * Math.PI, this.speed);
+                              this.posX(), this.posY(),
+                              (dir - d) * Math.PI, this.speed);
             trooper.addBullet(this.bullet, this.size, this.color,
-                              0, 0, (dir + d) * Math.PI, this.speed);
+                              this.posX(), this.posY(),
+                              (dir + d) * Math.PI, this.speed);
         }
 
@@ -87,7 +96,8 @@
         var angle = this.angle(trooper, enemy) - (this.delta * this.way / 2);
 
-        for (i = 0; i < this.way; i++) {
+        for (var i = 0; i < this.way; i++) {
             trooper.addBullet(this.bullet, this.size, this.color,
-                              0, 0, angle * Math.PI, this.speed);
+                              this.posX(), this.posY(),
+                              angle * Math.PI, this.speed);
             angle += this.delta;
         }
@@ -136,5 +146,6 @@
 
         trooper.addBullet(this.bullet, this.size, this.color,
-                          0, 0, this.curAngle * Math.PI, this.speed);
+                          this.posX(), this.posY(),
+                          this.curAngle * Math.PI, this.speed);
 
         this.curAngle += this.delta;
@@ -216,4 +227,102 @@
         return true;
     };
+    return that;
+};
+
+var MultiRounderBarrage = function(bullet, size, color,
+                                   interval, speed, way, dir,
+                                   klass, radius, num) {
+    if (radius == null) {
+        radius = size * way;
+        if (radius > 50)
+            radius = 50;
+    }
+
+    if (num == null)
+        num = Math.ceil((1 / way) * 50);
+
+    var start = 0.25;
+
+    this.initBarrage = function() {
+        this.brrg = new Array();
+        this.flag = new Array();
+
+        var w = Math.ceil(way / num);
+
+        for (var i = 0; i < num; i++) {
+            var b = new klass(bullet, size, color,
+                              interval, speed, w, dir);
+
+            b.r = radius;
+            b.posX = function() {
+                start += 1 / (num * 2);
+                this.a = i * (1 / num) + start;
+                return this.r * Math.cos(2 * Math.PI * this.a);
+            };
+
+            b.posY = function() {
+                return this.r * Math.sin(2 * Math.PI * this.a);
+            };
+
+            this.brrg.push(b);
+            this.flag.push(false);
+        }
+    };
+
+    this.update = function(trooper, enemy) {
+        for (var i = 0; i < this.brrg.length; i++) {
+            if (!this.flag[i])
+                this.flag[i] = this.brrg[i].update(trooper, enemy);
+        }
+        for (var i = 0; i < this.flag.length; i++) {
+            if (!this.flag[i])
+                return false;
+        }
+        this.initBarrage();
+        return true;
+    };
+
+    this.initBarrage();
+};
+
+var MultiRounderArchBarrage = function(bullet, size, color,
+                                       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,
+                                              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,
+                                                       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);
     return that;
 };
@@ -226,3 +335,9 @@
                      DelayedCircularBarrage,
                      DelayedRecursiveArchBarrage,
-                     DelayedRecursiveCircularBarrage];
+                     DelayedRecursiveCircularBarrage,
+                     MultiRounderArchBarrage,
+                     MultiRounderCircularBarrage,
+                     MultiRounderDelayedArchBarrage,
+                     MultiRounderDelayedCircularBarrage,
+                     MultiRounderDelayedRecursiveArchBarrage,
+                     MultiRounderDelayedRecursiveCircularBarrage];
