1. phuu
  2. Ghost

Commits

phuu  committed 15760c8

More comments. Few tiny modifications.

  • Participants
  • Parent commits 5f902bb
  • Branches default

Comments (0)

Files changed (2)

File Game.pde

View file
   
   int time = millis() - lastCast;
   
+  // Is raycasting neccessary yet?
   if(time > 500) {
     castFlag = true;
     lastCast = millis();
   }
   
   for(int i = 0; i < missiles.size(); i++) {
-    ((Missile)(missiles.get(i))).update();
-    if(((Missile)(missiles.get(i))).killFlag) missiles.remove(i);
+  	Missile m = (Missile)missiles.get(i);
+    m.update();
+    if(m.killFlag) missiles.remove(i);
   } 
   
+  /*
+	 This for loop is a terrible peice of code. I'm sorry to whoever sorts this out, probably me.
+	 I can't understand why I did it like this. Eurgh.
+  */
   for(int i = 0; i < barrels.size(); i++) {
     Barrel b = (Barrel)barrels.get(i);
     
         
         Boundary w = (Boundary)boundaries.get(j);
         
+        // This can be massively optimised
         for(int k = 0; k < players.size(); k++) {
           Blob cplayer = ((Blob)(players.get(k)));
           if(cplayer.local)
   
   return (unique) ? tID : genID(pre);
   
-}
+}

File GhostP1.pde

View file
 void keyReleased() {
   
   if(key == 'i') dev = !dev;
+  
   for(int i = 0; i < players.size(); i++) {
     Blob player = (Blob)players.get(i);
     if(player.local) player.ping(key);
     if(player.local) player.resetShot();
   }
 }
-
+