rename
authorFrank DeMarco <frank.s.demarco@gmail.com>
Mon, 28 Apr 2014 01:34:10 +0000 (10:34 +0900)
committerFrank DeMarco <frank.s.demarco@gmail.com>
Mon, 28 Apr 2014 01:34:10 +0000 (10:34 +0900)
35 files changed:
.gitignore
OFL.txt [new file with mode: 0644]
config
electric-sieve [moved from scale-sieve with 93% similarity]
electric_sieve/ElectricSieve.py [moved from scale_sieve/ScaleSieve.py with 94% similarity]
electric_sieve/__init__.py [moved from scale_sieve/pgfw/__init__.py with 100% similarity]
electric_sieve/pgfw/Animation.py [moved from scale_sieve/pgfw/Animation.py with 100% similarity]
electric_sieve/pgfw/Audio.py [moved from scale_sieve/pgfw/Audio.py with 100% similarity]
electric_sieve/pgfw/Configuration.py [moved from scale_sieve/pgfw/Configuration.py with 100% similarity]
electric_sieve/pgfw/Delegate.py [moved from scale_sieve/pgfw/Delegate.py with 100% similarity]
electric_sieve/pgfw/Display.py [moved from scale_sieve/pgfw/Display.py with 100% similarity]
electric_sieve/pgfw/Game.py [moved from scale_sieve/pgfw/Game.py with 100% similarity]
electric_sieve/pgfw/GameChild.py [moved from scale_sieve/pgfw/GameChild.py with 100% similarity]
electric_sieve/pgfw/Input.py [moved from scale_sieve/pgfw/Input.py with 100% similarity]
electric_sieve/pgfw/Interpolator.py [moved from scale_sieve/pgfw/Interpolator.py with 100% similarity]
electric_sieve/pgfw/Mainloop.py [moved from scale_sieve/pgfw/Mainloop.py with 100% similarity]
electric_sieve/pgfw/Profile.py [moved from scale_sieve/pgfw/Profile.py with 100% similarity]
electric_sieve/pgfw/ScreenGrabber.py [moved from scale_sieve/pgfw/ScreenGrabber.py with 100% similarity]
electric_sieve/pgfw/Setup.py [moved from scale_sieve/pgfw/Setup.py with 100% similarity]
electric_sieve/pgfw/SetupWin.py [moved from scale_sieve/pgfw/SetupWin.py with 100% similarity]
electric_sieve/pgfw/Sprite.py [moved from scale_sieve/pgfw/Sprite.py with 100% similarity]
electric_sieve/pgfw/TimeFilter.py [moved from scale_sieve/pgfw/TimeFilter.py with 100% similarity]
electric_sieve/pgfw/Vector.py [moved from scale_sieve/pgfw/Vector.py with 100% similarity]
electric_sieve/pgfw/VideoRecorder.py [moved from scale_sieve/pgfw/VideoRecorder.py with 100% similarity]
electric_sieve/pgfw/__init__.py [moved from scale_sieve/__init__.py with 100% similarity]
resource/aud/0Sj-99_Em.wav [new file with mode: 0644]
resource/aud/777.ogg [new file with mode: 0644]
resource/aud/Heat.ogg [new file with mode: 0644]
resource/aud/It.wav [new file with mode: 0644]
resource/aud/Meld.ogg [new file with mode: 0644]
resource/aud/Sarcophagus-Soar-and-to-Commune.ogg [new file with mode: 0644]
resource/aud/Skinball.wav [new file with mode: 0644]
resource/font/Oxygen-Regular.ttf [new file with mode: 0644]
resource/font/Titan-One.ttf [new file with mode: 0644]
resource/high-scores [new file with mode: 0644]

index 0d20b64..a90eb31 100644 (file)
@@ -1 +1,2 @@
 *.pyc
+resource/local/
diff --git a/OFL.txt b/OFL.txt
new file mode 100644 (file)
index 0000000..905e1d6
--- /dev/null
+++ b/OFL.txt
@@ -0,0 +1,92 @@
+Copyright (c) 2012, vernon adams (vern@newtypography.co.uk), with Reserved Font Names 'Oxygen'\r
+This Font Software is licensed under the SIL Open Font License, Version 1.1.\r
+This license is copied below, and is also available with a FAQ at:\r
+http://scripts.sil.org/OFL\r
+\r
+\r
+-----------------------------------------------------------\r
+SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007\r
+-----------------------------------------------------------\r
+\r
+PREAMBLE\r
+The goals of the Open Font License (OFL) are to stimulate worldwide\r
+development of collaborative font projects, to support the font creation\r
+efforts of academic and linguistic communities, and to provide a free and\r
+open framework in which fonts may be shared and improved in partnership\r
+with others.\r
+\r
+The OFL allows the licensed fonts to be used, studied, modified and\r
+redistributed freely as long as they are not sold by themselves. The\r
+fonts, including any derivative works, can be bundled, embedded, \r
+redistributed and/or sold with any software provided that any reserved\r
+names are not used by derivative works. The fonts and derivatives,\r
+however, cannot be released under any other type of license. The\r
+requirement for fonts to remain under this license does not apply\r
+to any document created using the fonts or their derivatives.\r
+\r
+DEFINITIONS\r
+"Font Software" refers to the set of files released by the Copyright\r
+Holder(s) under this license and clearly marked as such. This may\r
+include source files, build scripts and documentation.\r
+\r
+"Reserved Font Name" refers to any names specified as such after the\r
+copyright statement(s).\r
+\r
+"Original Version" refers to the collection of Font Software components as\r
+distributed by the Copyright Holder(s).\r
+\r
+"Modified Version" refers to any derivative made by adding to, deleting,\r
+or substituting -- in part or in whole -- any of the components of the\r
+Original Version, by changing formats or by porting the Font Software to a\r
+new environment.\r
+\r
+"Author" refers to any designer, engineer, programmer, technical\r
+writer or other person who contributed to the Font Software.\r
+\r
+PERMISSION & CONDITIONS\r
+Permission is hereby granted, free of charge, to any person obtaining\r
+a copy of the Font Software, to use, study, copy, merge, embed, modify,\r
+redistribute, and sell modified and unmodified copies of the Font\r
+Software, subject to the following conditions:\r
+\r
+1) Neither the Font Software nor any of its individual components,\r
+in Original or Modified Versions, may be sold by itself.\r
+\r
+2) Original or Modified Versions of the Font Software may be bundled,\r
+redistributed and/or sold with any software, provided that each copy\r
+contains the above copyright notice and this license. These can be\r
+included either as stand-alone text files, human-readable headers or\r
+in the appropriate machine-readable metadata fields within text or\r
+binary files as long as those fields can be easily viewed by the user.\r
+\r
+3) No Modified Version of the Font Software may use the Reserved Font\r
+Name(s) unless explicit written permission is granted by the corresponding\r
+Copyright Holder. This restriction only applies to the primary font name as\r
+presented to the users.\r
+\r
+4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font\r
+Software shall not be used to promote, endorse or advertise any\r
+Modified Version, except to acknowledge the contribution(s) of the\r
+Copyright Holder(s) and the Author(s) or with their explicit written\r
+permission.\r
+\r
+5) The Font Software, modified or unmodified, in part or in whole,\r
+must be distributed entirely under this license, and must not be\r
+distributed under any other license. The requirement for fonts to\r
+remain under this license does not apply to any document created\r
+using the Font Software.\r
+\r
+TERMINATION\r
+This license becomes null and void if any of the above conditions are\r
+not met.\r
+\r
+DISCLAIMER\r
+THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\r
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT\r
+OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE\r
+COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\r
+INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL\r
+DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\r
+FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM\r
+OTHER DEALINGS IN THE FONT SOFTWARE.\r
diff --git a/config b/config
index 84fb38e..bd3f1c8 100644 (file)
--- a/config
+++ b/config
@@ -1,8 +1,8 @@
 [display]
 caption = Electric Sieve
 dimensions = 420, 700
-score-font-path = Titan-One.ttf
-title-font-path = Oxygen.ttf
+score-font-path = font/Titan-One.ttf
+title-font-path = font/Oxygen.ttf
 
 [mouse]
 visible = no
@@ -14,6 +14,15 @@ advance = K_RETURN
 [score]
 path = high-scores
 
+[audio]
+title = aud/Meld.ogg
+title-advance = aud/It.wav
+triangles = aud/777.ogg
+hit = aud/Skinball.wav
+miss = aud/0Sj-99_Em.wav
+end = aud/Sarcophagus-Soar-and-to-Commune.ogg
+noise = aud/Heat.ogg
+
 [interpolate]
 volume = C 0.0 0.0, 16.0 0.61, 80.0 1.0
 scale = C 0.0 40.0, 400.0 140.0
similarity index 93%
rename from scale-sieve
rename to electric-sieve
index 250d984..1a24b05 100755 (executable)
@@ -38,6 +38,6 @@ if not can_import("pygame"):
 if "--go-to-dir" in argv:
     move_to_executable()
 
-from scale_sieve.ScaleSieve import ScaleSieve
+from electric_sieve.ElectricSieve import ElectricSieve
 
-ScaleSieve().run()
+ElectricSieve().run()
similarity index 94%
rename from scale_sieve/ScaleSieve.py
rename to electric_sieve/ElectricSieve.py
index d7c2420..e107dd1 100644 (file)
@@ -6,13 +6,14 @@ from time import time
 from pygame import Surface, PixelArray, Rect
 from pygame.draw import aalines, polygon
 from pygame.font import Font
+from pygame.mixer import Sound
 from pygame.locals import *
 
-from scale_sieve.pgfw.Game import Game
-from scale_sieve.pgfw.GameChild import GameChild
-from scale_sieve.pgfw.Sprite import Sprite
+from electric_sieve.pgfw.Game import Game
+from electric_sieve.pgfw.GameChild import GameChild
+from electric_sieve.pgfw.Sprite import Sprite
 
-class ScaleSieve(Game):
+class ElectricSieve(Game):
 
     def __init__(self):
         Game.__init__(self)
@@ -74,6 +75,8 @@ class Title(GameChild):
         captions[0].location.center = cx, 301
         captions[1].location.center = cx, 398
         self.scoreboard = Scoreboard(self)
+        self.music = Sound(self.get_resource("audio", "title"))
+        self.advance = Sound(self.get_resource("audio", "title-advance"))
         self.subscribe(self.respond)
 
     def respond(self, event):
@@ -83,12 +86,15 @@ class Title(GameChild):
                 self.parent.triangles.activate()
                 self.parent.sieve.activate()
                 self.parent.static.activate()
+                self.advance.play()
 
     def activate(self):
         self.active = True
+        self.music.play(-1)
 
     def deactivate(self):
         self.active = False
+        self.music.fadeout(500)
 
     def update(self):
         if self.active:
@@ -301,15 +307,19 @@ class Triangles(GameChild, list):
 
     def __init__(self, parent):
         GameChild.__init__(self, parent)
+        self.music = Sound(self.get_resource("audio", "triangles"))
         self.deactivate()
         self.display_surface = self.get_display_surface()
         self.delegate = self.get_game().delegate
         self.booster = Shift(self, 1, "boost")
+        self.hit = Sound(self.get_resource("audio", "hit"))
+        self.miss = Sound(self.get_resource("audio", "miss"))
         self.reset()
         self.subscribe(self.respond)
 
     def deactivate(self):
         self.active = False
+        self.music.fadeout(500)
 
     def reset(self):
         list.__init__(self, [])
@@ -341,6 +351,7 @@ class Triangles(GameChild, list):
 
     def activate(self):
         self.active = True
+        self.music.play(-1, 0, 500)
 
     def update(self):
         if self.active:
@@ -355,6 +366,7 @@ class Triangles(GameChild, list):
                                   self.parent.acid.get_volume() * 5 + \
                                   self[0].count
                     self.remove(self[0])
+                    self.hit.play()
                 else:
                     for br in sieve.bar_rects:
                         for tr in self[0].collision_rects:
@@ -364,6 +376,7 @@ class Triangles(GameChild, list):
                                 self.remove(self[0])
                                 self.parent.static.increase()
                                 self.streak = 0
+                                self.miss.play()
                                 break
             for triangle in self:
                 triangle.update()
@@ -436,6 +449,8 @@ class Static(Sprite):
 
     def __init__(self, parent):
         Sprite.__init__(self, parent, 120)
+        self.noise = Sound(self.get_resource("audio", "noise"))
+        self.end = Sound(self.get_resource("audio", "end"))
         self.deactivate()
         self.delegate = self.get_game().delegate
         self.increaser = Shift(self, 1, "intensity")
@@ -446,10 +461,12 @@ class Static(Sprite):
 
     def deactivate(self):
         self.active = False
+        self.end.fadeout(500)
 
     def reset(self):
         self.complete = False
         self.intensity = 0
+        self.noise.set_volume(0)
         self.increaser.reset()
 
     def add_frames(self):
@@ -490,7 +507,6 @@ class Static(Sprite):
 
     def increase(self):
         self.intensity += self.increaser.get_change()
-        print self.increaser.get_change()
         if self.intensity > 1:
             self.intensity = 1
         self.increaser.time += 12000
@@ -499,6 +515,7 @@ class Static(Sprite):
 
     def activate(self):
         self.active = True
+        self.noise.play(-1)
 
     def update(self):
         if self.active:
@@ -507,12 +524,15 @@ class Static(Sprite):
                 self.parent.sieve.deactivate()
                 self.parent.triangles.deactivate()
                 self.set_alpha(255)
+                self.noise.fadeout(6000)
+                self.end.play(-1, 0, 4000)
                 self.total.load()
             elif not self.complete:
                 self.set_alpha(int(self.intensity * 255))
                 if self.intensity > 0:
                     self.intensity *= .998
                 self.increaser.update()
+                self.noise.set_volume(self.intensity)
             Sprite.update(self)
             self.total.update()
 
diff --git a/resource/aud/0Sj-99_Em.wav b/resource/aud/0Sj-99_Em.wav
new file mode 100644 (file)
index 0000000..ffb8051
Binary files /dev/null and b/resource/aud/0Sj-99_Em.wav differ
diff --git a/resource/aud/777.ogg b/resource/aud/777.ogg
new file mode 100644 (file)
index 0000000..41d0ad8
Binary files /dev/null and b/resource/aud/777.ogg differ
diff --git a/resource/aud/Heat.ogg b/resource/aud/Heat.ogg
new file mode 100644 (file)
index 0000000..559d427
Binary files /dev/null and b/resource/aud/Heat.ogg differ
diff --git a/resource/aud/It.wav b/resource/aud/It.wav
new file mode 100644 (file)
index 0000000..67f631f
Binary files /dev/null and b/resource/aud/It.wav differ
diff --git a/resource/aud/Meld.ogg b/resource/aud/Meld.ogg
new file mode 100644 (file)
index 0000000..e2947c1
Binary files /dev/null and b/resource/aud/Meld.ogg differ
diff --git a/resource/aud/Sarcophagus-Soar-and-to-Commune.ogg b/resource/aud/Sarcophagus-Soar-and-to-Commune.ogg
new file mode 100644 (file)
index 0000000..50af5e2
Binary files /dev/null and b/resource/aud/Sarcophagus-Soar-and-to-Commune.ogg differ
diff --git a/resource/aud/Skinball.wav b/resource/aud/Skinball.wav
new file mode 100644 (file)
index 0000000..96a0aff
Binary files /dev/null and b/resource/aud/Skinball.wav differ
diff --git a/resource/font/Oxygen-Regular.ttf b/resource/font/Oxygen-Regular.ttf
new file mode 100644 (file)
index 0000000..a66ddf1
Binary files /dev/null and b/resource/font/Oxygen-Regular.ttf differ
diff --git a/resource/font/Titan-One.ttf b/resource/font/Titan-One.ttf
new file mode 100644 (file)
index 0000000..04535bf
Binary files /dev/null and b/resource/font/Titan-One.ttf differ
diff --git a/resource/high-scores b/resource/high-scores
new file mode 100644 (file)
index 0000000..455a5fc
--- /dev/null
@@ -0,0 +1,16 @@
+1398631170.296798 200
+1398631170.296798 100
+1398631170.296798 40
+1398635621.7 158
+1398635792.99 154
+1398636058.07 180
+1398636195.37 232
+1398636310.09 131
+1398636404.1 120
+1398636488.41 165
+1398636581.89 173
+1398636667.8 186
+1398647055.97 78
+1398647195.17 187
+1398647939.59 155
+1398648230.57 88