Index: pycodeshooter/trunk/shooter/system.js
===================================================================
--- pycodeshooter/trunk/shooter/system.js	(revision 129)
+++ pycodeshooter/trunk/shooter/system.js	(revision 130)
@@ -30,4 +30,5 @@
     "backgroundObject": new Array(),
     "deathPieces":      new Array(),
+    "items":            new Array(),
     "mainIntervalId":   0
 };
@@ -95,4 +96,72 @@
 
     System.deathPieces = newObjs;
+}
+
+
+/*
+ *  Item Utilities
+ */
+function addItem(x, y, angle, size, color, speed, attrs) {
+    var frame = {"style": "rect", "color": attrs.color, "width": size * 2, "height": size * 2};
+    var item  = new YExtendBullet(size, color, frame,
+                                  System.screen.width, System.screen.height,
+                                  x, y, angle * Math.PI, speed);
+    item.attrs = attrs;
+    System.items.push(item);
+}
+
+function updateItems(ctx, width, height, troopers) {
+    var newObjs = new Array();
+
+  ITEMLOOP:
+    for (var i = 0; i < System.items.length; i++) {
+        var item = System.items[i];
+
+        item.next();
+        item.draw(ctx, function(bullet, ctx) {
+            drawString(
+                ctx, "source-over", item.attrs.symbol,
+                bullet.x, bullet.y,
+                item.attrs.color, item.size + "pt monospace", "center"
+            );
+        });
+
+        for (var j = 0; j < troopers.length; j++) {
+            var trooper = troopers[j];
+
+            if (touch(trooper.x, trooper.y, trooper.size, item.x, item.y, item.size)) {
+                switch (item.attrs.type) {
+                case "score":
+                    playSound("se_item_score");
+                    if (System.score[trooper.name] !== undefined)
+                        System.score[trooper.name] += item.attrs.quantity;
+                    break;
+                case "shot":
+                    playSound("se_item_shot");
+                    for (var k = 0; k < trooper.barrages.length; k++) {
+                        trooper.barrages[k].way += item.attrs.quantity;
+                        if (trooper.barrages[k].way >= 10)
+                            trooper.barrages[k].way = 10;
+                    }
+                    break;
+                case "bomb":
+                    playSound("se_item_bomb");
+                    trooper.numBombs += item.attrs.quantity;
+                    break;
+                case "life":
+                    playSound("se_item_life");
+                    trooper.life += item.attrs.quantity;
+                    break;
+                }
+
+                continue ITEMLOOP;
+            }
+        }
+
+        if (!item.vanished(width, height))
+            newObjs.push(item);
+    }
+
+    System.items = newObjs;
 }
 
@@ -355,4 +424,25 @@
                 [6, 8, 10], ["#F55", "#FAA"], 3, 8
             );
+
+            var itemAttr;
+            var itemRand = Math.floor(Math.random() * 100);
+            if (itemRand < 40) {
+                // nothing
+            }
+            else if (itemRand < 75) {
+                itemAttr = {"color": "#AAF", "symbol": "S", "type": "score", "quantity": enemy.maxLife * 200};
+            }
+            else if (itemRand < 95) {
+                itemAttr = {"color": "#FAA", "symbol": "P", "type": "shot", "quantity": 1};
+            }
+            else if (itemRand < 98) {
+                itemAttr = {"color": "#FFA", "symbol": "B", "type": "bomb", "quantity": 1};
+            }
+            else {
+                itemAttr = {"color": "#AFA", "symbol": "L", "type": "life", "quantity": 1};
+            }
+
+            if (itemAttr)
+                addItem(enemy.x, enemy.y, 0.5, 5, "#AFA", 1, itemAttr);
         }
         else {
@@ -396,5 +486,5 @@
         "STAGE " + getStageNumber(),
         System.screen.width - 10,
-        System.screen.height - 15,
+        15,
         "#ACF", "9pt monospace", "right"
     );
@@ -409,8 +499,14 @@
             name + " SCORE " + System.score[name],
             (System.screen.width - 10),
-            i * 16 + 15,
+            i * 16 + 30,
             "#ACF", "9pt monospace", "right"
         );
     }
+
+    // update/draw items
+    updateItems(System.screen.ctx,
+                System.screen.width,
+                System.screen.height,
+                System.players);
 
     // update/draw troopers
@@ -436,4 +532,13 @@
             (System.screen.height - 23) - (i * 33),
             "#ACF", "9pt monospace", "left"
+        );
+
+        drawString(
+            System.screen.ctx,
+            "source-over",
+            "BOMB " + player.numBombs,
+            (System.screen.width - 10),
+            (System.screen.height - 23) - (i * 33),
+            "#ACF", "9pt monospace", "right"
         );
     }
@@ -522,5 +627,5 @@
                           playerData.shotlevel,
                           -0.5),
-         new LinerBarrage(YExtendBullet,
+         new LinerBarrage(LinerBullet,
                           playerData.shotsize,
                           "rgba(64,64,128,0.7)",
@@ -529,12 +634,4 @@
                           playerData.shotspeed,
                           playerData.shotlevel,
-                          0.5),
-         new CircularBarrage(LinerBullet,
-                          playerData.shotsize,
-                          "rgba(64,64,128,0.7)",
-                          null,
-                          playerData.shotinterval,
-                          playerData.shotspeed,
-                          playerData.shotlevel + 2,
                           -0.5)]
     );
@@ -554,4 +651,23 @@
         trooper.x = System.screen.width / 2;
         trooper.y = System.screen.height - System.screen.height / 7;
+        trooper.numBombs = playerData.numbombs;
+        trooper.barrages = [
+            new LinerBarrage(YExtendBullet,
+                             playerData.shotsize,
+                             "rgba(64,64,128,0.7)",
+                             null,
+                             playerData.shotinterval,
+                             playerData.shotspeed,
+                             playerData.shotlevel,
+                             -0.5),
+            new LinerBarrage(LinerBullet,
+                             playerData.shotsize,
+                             "rgba(64,64,128,0.7)",
+                             null,
+                             playerData.shotinterval,
+                             playerData.shotspeed,
+                             playerData.shotlevel,
+                             -0.5)
+        ];
     });
 
