sound
authorFrank DeMarco <frank.s.demarco@gmail.com>
Sun, 25 May 2014 23:48:58 +0000 (08:48 +0900)
committerFrank DeMarco <frank.s.demarco@gmail.com>
Sun, 25 May 2014 23:48:58 +0000 (08:48 +0900)
14 files changed:
MANIFEST.in [new file with mode: 0644]
config
lake_of_heavenly_wind/LakeOfHeavenlyWind.py
resource/aud/Fever-for-Immolation-Ruins.ogg
resource/aud/Knife-Glory/01.ogg [new file with mode: 0644]
resource/aud/Knife-Glory/9i.ogg [new file with mode: 0644]
resource/aud/Knife-Glory/Mb.ogg [new file with mode: 0644]
resource/aud/Knife-Glory/No.ogg [new file with mode: 0644]
resource/aud/Knife-Glory/O0.ogg [new file with mode: 0644]
resource/aud/Knife-Glory/eE.ogg [new file with mode: 0644]
resource/aud/Knife-Glory/no.ogg [new file with mode: 0644]
resource/aud/Knife-Glory/ww.ogg [new file with mode: 0644]
resource/high-scores
resource/wt009.ttf [new file with mode: 0644]

diff --git a/MANIFEST.in b/MANIFEST.in
new file mode 100644 (file)
index 0000000..c8a1bb8
--- /dev/null
@@ -0,0 +1,3 @@
+include config
+recursive-include resource *
+prune resource/local
diff --git a/config b/config
index fc4174c..83a0836 100644 (file)
--- a/config
+++ b/config
@@ -24,7 +24,7 @@ advance = K_RETURN
 quit = K_ESCAPE
 
 [display]
-font = local/wangfonts/wt009.ttf
+font = wt009.ttf
 
 [image]
 plateau = img/B59-plus.png
@@ -34,6 +34,7 @@ pulp = img/Burns-1930/
 [audio]
 inner = aud/Sunpeak-Capsaicin.ogg
 outer = aud/Fever-for-Immolation-Ruins.ogg
+fx = aud/Knife-Glory/
 
 [text]
 scores = high-scores
index f1806cf..9670130 100644 (file)
@@ -246,6 +246,14 @@ class Title(GameChild):
             self.caption.update()
 
 
+class SoundEffect(GameChild, Sound):
+
+    def __init__(self, parent, name):
+        GameChild.__init__(self, parent)
+        Sound.__init__(self, join(self.get_resource("audio", "fx"),
+                                  name + ".ogg"))
+
+
 class GameScreen(GameChild):
 
     PALETTE = [[(191, 191, 220), (191, 255, 191)],
@@ -402,6 +410,7 @@ class Pulp(GameChild, Surface):
         self.display_surface = self.get_display_surface()
         self.font = Font(self.get_resource("display", "font"), 24)
         self.explosions = [Explosion(self) for _ in xrange(32)]
+        self.lose_health_fx = SoundEffect(self, "No")
         self.reset()
         Surface.__init__(self, (self.display_surface.get_width(), 96))
         self.rect = self.get_rect()
@@ -485,6 +494,8 @@ class Pulp(GameChild, Surface):
                 if self.health < 0:
                     self.parent.end()
                     break
+        if outgoing:
+            self.lose_health_fx.play()
         for phage in outgoing:
             self.parent.rails.phages.remove(phage)
         for explosion in self.explosions:
@@ -565,6 +576,9 @@ class Paddles(GameChild):
         self.time_filter = self.get_game().time_filter
         self.display_surface = self.get_display_surface()
         self.delegate = self.get_game().delegate
+        self.detonate_mine_fx = SoundEffect(self, "ww")
+        self.drop_mine_fx = SoundEffect(self, "ww")
+        # self.eliminate_phage_fx = SoundEffect(self, "Mb")
         self.graticule_y = 0
         self.set_background()
         self.set_lattice()
@@ -705,6 +719,7 @@ class Paddles(GameChild):
                 mine.set_frameset("explode")
         for location in self.graticule.locations:
             location.unhide()
+        self.detonate_mine_fx.play()
 
     def respond(self, event):
         if self.parent.active and not self.parent.ending:
@@ -737,6 +752,9 @@ class Paddles(GameChild):
                         for phage in outgoing:
                             self.parent.rails.phages.remove(phage)
                         self.active_mines[side].remove(mine)
+                    self.detonate_mine_fx.play()
+                    # if outgoing:
+                    #     self.eliminate_phage_fx.play()
                     for location in self.graticule.locations:
                         if location.side == side:
                             location.unhide()
@@ -753,6 +771,7 @@ class Paddles(GameChild):
                                     break
                             self.active_mines[side].append(mine)
                             location.hide()
+                    self.drop_mine_fx.play()
 
     def update(self):
         for ii in xrange(len(self.throttle)):
@@ -1017,6 +1036,7 @@ class Oracle(Animation):
         Animation.__init__(self, parent)
         self.time_filter = self.get_game().time_filter
         self.display_surface = self.get_display_surface()
+        # self.line_appears_fx = SoundEffect(self, "no")
         screens = self.screens = []
         for ii in xrange(2):
             surface = Surface((48, 48), SRCALPHA)
@@ -1093,6 +1113,7 @@ class Oracle(Animation):
                                       play_once=True)
                         self.flips = 0
                         self.waiting = True
+                        # self.line_appears_fx.play()
         elif self.waiting:
             self.wait_elapsed += self.time_filter.get_last_frame_duration()
             if self.wait_elapsed > 7500:
@@ -1120,6 +1141,7 @@ class Animals(GameChild, list):
 
     def __init__(self, parent):
         GameChild.__init__(self, parent)
+        self.collect_token_fx = SoundEffect(self, "01")
         font = Font(self.get_resource("display", "font"), 18)
         color = Color(0, 0, 0)
         for glyph in [u"馬", u"羊", u"雉", u"龍", u"雞", u"豕", u"狗", u"牛"]:
@@ -1173,6 +1195,7 @@ class Animals(GameChild, list):
                     location.centerx += paddles.paddle_length + paddles.margin
             if self.in_motion.location.colliderect(paddles.paddles.location):
                 paddles.arrange_graticules(self.index(self.in_motion) + 1)
+                self.collect_token_fx.play()
                 self.hide()
             else:
                 self.in_motion.move(dy=4)
index 634c181..233dfe5 100644 (file)
Binary files a/resource/aud/Fever-for-Immolation-Ruins.ogg and b/resource/aud/Fever-for-Immolation-Ruins.ogg differ
diff --git a/resource/aud/Knife-Glory/01.ogg b/resource/aud/Knife-Glory/01.ogg
new file mode 100644 (file)
index 0000000..002c18e
Binary files /dev/null and b/resource/aud/Knife-Glory/01.ogg differ
diff --git a/resource/aud/Knife-Glory/9i.ogg b/resource/aud/Knife-Glory/9i.ogg
new file mode 100644 (file)
index 0000000..c5d167a
Binary files /dev/null and b/resource/aud/Knife-Glory/9i.ogg differ
diff --git a/resource/aud/Knife-Glory/Mb.ogg b/resource/aud/Knife-Glory/Mb.ogg
new file mode 100644 (file)
index 0000000..371af5a
Binary files /dev/null and b/resource/aud/Knife-Glory/Mb.ogg differ
diff --git a/resource/aud/Knife-Glory/No.ogg b/resource/aud/Knife-Glory/No.ogg
new file mode 100644 (file)
index 0000000..348b0ae
Binary files /dev/null and b/resource/aud/Knife-Glory/No.ogg differ
diff --git a/resource/aud/Knife-Glory/O0.ogg b/resource/aud/Knife-Glory/O0.ogg
new file mode 100644 (file)
index 0000000..d976b4a
Binary files /dev/null and b/resource/aud/Knife-Glory/O0.ogg differ
diff --git a/resource/aud/Knife-Glory/eE.ogg b/resource/aud/Knife-Glory/eE.ogg
new file mode 100644 (file)
index 0000000..3dcd1fa
Binary files /dev/null and b/resource/aud/Knife-Glory/eE.ogg differ
diff --git a/resource/aud/Knife-Glory/no.ogg b/resource/aud/Knife-Glory/no.ogg
new file mode 100644 (file)
index 0000000..016dd33
Binary files /dev/null and b/resource/aud/Knife-Glory/no.ogg differ
diff --git a/resource/aud/Knife-Glory/ww.ogg b/resource/aud/Knife-Glory/ww.ogg
new file mode 100644 (file)
index 0000000..61b024e
Binary files /dev/null and b/resource/aud/Knife-Glory/ww.ogg differ
index 6b6476d..31f1404 100644 (file)
@@ -1,36 +1,5 @@
-20
-30
-50
-80
-100
-86
-630
-369
-98
-75
-59
-91
-438
-773
-816
-1440
-1054
-1034
-978
-964
-554
-92
-192
-169
-85
-83
-84
-98
-82
-1815
-185
-1151
-1442
-1680
-1760
-354
+400
+700
+1000
+1200
+1500
diff --git a/resource/wt009.ttf b/resource/wt009.ttf
new file mode 100644 (file)
index 0000000..a90a40f
Binary files /dev/null and b/resource/wt009.ttf differ