max score
authorFrank DeMarco <frank.s.demarco@gmail.com>
Sat, 31 May 2014 11:02:45 +0000 (20:02 +0900)
committerFrank DeMarco <frank.s.demarco@gmail.com>
Sat, 31 May 2014 11:02:45 +0000 (20:02 +0900)
lake_of_heavenly_wind/LakeOfHeavenlyWind.py
resource/high-scores

index cb6f7de..926f07d 100644 (file)
@@ -133,7 +133,7 @@ class Title(GameChild):
         self.display_surface = self.get_display_surface()
         self.delegate = self.get_game().delegate
         self.music = Sound(self.get_resource("audio", "outer"))
-        self.start_fx = SoundEffect(self, "start", .5)
+        self.start_fx = SoundEffect(self, "start", .4)
         self.deactivate()
         background = self.background = Sprite(self)
         tile_size = self.tile_size = 8
@@ -761,6 +761,7 @@ class Paddles(GameChild):
                     outgoing = []
                     count = len(self.active_mines[side])
                     mine_total_x = 0
+                    hit = []
                     while self.active_mines[side]:
                         mine = self.active_mines[side][0]
                         mine_total_x += mine.location.centerx
@@ -777,15 +778,16 @@ class Paddles(GameChild):
                                 start = phage.health
                                 phage.health -= 1.5 * (reach - float(d)) / reach
                                 if phage.health < 0:
-                                    found = False
-                                    for record in outgoing:
-                                        if record[0] == phage:
-                                            found = True
-                                            if record[1] < start:
-                                                record[1] = start
-                                            break
-                                    if not found:
+                                    if phage not in (r[0] for r in outgoing):
+                                        for record in hit:
+                                            if record[0] == phage:
+                                                start = record[1]
+                                                hit.remove(record)
+                                                break
                                         outgoing.append((phage, start))
+                                else:
+                                    if phage not in (r[0] for r in hit):
+                                        hit.append((phage, start))
                         self.active_mines[side].remove(mine)
                     self.detonate_mine_fx.play(float(mine_total_x) / count / \
                                                self.get_display_surface(). \
@@ -798,6 +800,8 @@ class Paddles(GameChild):
                         record[0].play(record[0].die)
                         # self.parent.rails.phages.remove(record[0])
                     self.parent.pulp.score += increase * len(outgoing) * 10
+                    if increase:
+                        print increase * len(outgoing) * 10, len(outgoing)
                     if outgoing:
                         self.eliminate_phage_fx.play(float(phage_total_x) / \
                                                      len(outgoing) / \
@@ -1082,7 +1086,6 @@ class Phage(Animation):
         for segment in self.body:
             alpha = segment.alpha - 48
             if alpha <= 0:
-                print self.parent.phages
                 self.parent.phages.remove(self)
                 self.halt()
                 break
index 58de7d8..228bffc 100644 (file)
@@ -23,3 +23,4 @@
 1510
 1603
 1340
+1697