single track
authorFrank DeMarco <frank.s.demarco@gmail.com>
Thu, 29 May 2014 22:48:48 +0000 (07:48 +0900)
committerFrank DeMarco <frank.s.demarco@gmail.com>
Thu, 29 May 2014 22:48:48 +0000 (07:48 +0900)
config
lake_of_heavenly_wind/LakeOfHeavenlyWind.py
resource/high-scores

diff --git a/config b/config
index 69466e1..f606f1c 100644 (file)
--- a/config
+++ b/config
@@ -39,14 +39,15 @@ book = Book-of-Changes
 scores = high-scores
 
 [interpolate]
-spawn = C 0.0 0.02, 2.0 0.042, 11.0 0.087, 15.0 0.12
+shoot = C 0.0 22.0, 0.79 17.0, 1.0 14.0
+spawn = C 0.0 0.01, 2.1 0.029, 10.0 0.047, 15.0 0.075
 deviation-11 = L 0.0 -1.0, 0.25 -0.5, 0.5 1.0, 0.75 1.5, 1.0 0.0
 deviation-10 = C 0.0 0.0, 0.12 -0.25, 0.25 0.25, 0.38 -0.25, 0.5 0.25, 0.62 -0.25, 0.75 0.25, 0.88 -0.25, 1.0 0.0
 deviation-13 = C 0.0 0.3, 0.5 -0.75, 1.0 0.0
 deviation-12 = C 0.0 0.0, 0.5 2.0, 1.0 0.0
 deviation-9 = L 0.0 0.0, 0.75 1.2, 1.0 0.0
 deviation-8 = C 0.0 0.0, 0.5 1.5, 0.8 0.0, 1.0 0.0
-step = C 0.0 0.003, 2.7 0.0037, 12.0 0.0046, 15.0 0.0055
+step = C 0.0 0.006, 3.4 0.0079, 15.0 0.01
 deviation-1 = C 0.0 0.0, 0.5 1.1, 0.75 -0.3, 1.0 0.0
 deviation-3 = L 0.0 -0.75, 1.0 0.0
 deviation-2 = L 0.0 3.0, 1.0 0.0
index 060b44c..80add0a 100644 (file)
@@ -467,8 +467,8 @@ class Pulp(GameChild, Surface):
                 indicator.move(dy=self.image_r.h)
         self.indicators[int(self.health * len(self.indicators))].update()
         self.display_surface.blit(self, self.rect)
-        if not self.parent.is_frozen():
-            self.score += self.health * .1
+        if not self.parent.is_frozen():
+            self.score += self.health * .1
         text = str(int(self.score))
         color = randint(0, 120), randint(0, 120), randint(0, 120)
         for ii, digit in enumerate(text):
@@ -734,25 +734,37 @@ class Paddles(GameChild):
                       compare(event, "release-right")):
                 side = self.LEFT if event.command == "release-left" else self.RIGHT
                 if self.active_mines[side]:
+                    outgoing = []
                     while self.active_mines[side]:
                         mine = self.active_mines[side][0]
                         center = mine.location.center
                         mine.set_frameset("explode")
                         mine.location.center = center
                         mine.get_current_frameset().reset()
-                        outgoing = []
                         for phage in self.parent.rails.phages:
                             px, py = phage.get_center()
                             d = sqrt((px - mine.location.centerx) ** 2 + \
                                      (py - mine.location.centery) ** 2)
                             reach = 100
                             if d < reach:
+                                start = phage.health
                                 phage.health -= 1.5 * (reach - float(d)) / reach
                                 if phage.health < 0:
-                                    outgoing.append(phage)
-                        for phage in outgoing:
-                            self.parent.rails.phages.remove(phage)
+                                    found = False
+                                    for record in outgoing:
+                                        if record[0] == phage:
+                                            found = True
+                                            if record[1] < start:
+                                                record[1] = start
+                                            break
+                                    if not found:
+                                        outgoing.append((phage, start))
                         self.active_mines[side].remove(mine)
+                    increase = 0
+                    for record in outgoing:
+                        increase += record[1]
+                        self.parent.rails.phages.remove(record[0])
+                    self.parent.pulp.score += increase * len(outgoing) * 10
                     self.detonate_mine_fx.play()
                     # if outgoing:
                     #     self.eliminate_phage_fx.play()
@@ -789,7 +801,12 @@ class Paddles(GameChild):
             self.paddles.move(ds.get_width())
         elif self.paddles.location.right > ds.get_width():
             self.paddles.move(-ds.get_width())
-        self.graticule.move(dy=-14)
+        y = self.graticule.location.centery
+        start = self.parent.link.background.rect.bottom
+        end = ds.get_height() - 32
+        position = (end - y) / float(end - start)
+        dy = self.get_game().interpolator.get_nodeset("shoot").get_y(position)
+        self.graticule.move(dy=-dy)
         for location in self.graticule.locations:
             if location.right < 0:
                 location.move_ip(ds.get_width(), 0)
index ef68747..819be35 100644 (file)
@@ -6,3 +6,9 @@
 1429
 1295
 1359
+3551
+827
+1425
+1643
+1198
+1014