diff --git a/.gitignore b/.gitignore index 0d20b64..a90eb31 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ *.pyc +resource/local/ diff --git a/OFL.txt b/OFL.txt new file mode 100644 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' +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/config b/config index 84fb38e..bd3f1c8 100644 --- 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 diff --git a/scale-sieve b/electric-sieve similarity index 93% rename from scale-sieve rename to electric-sieve index 250d984..1a24b05 100755 --- a/scale-sieve +++ b/electric-sieve @@ -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() diff --git a/scale_sieve/ScaleSieve.py b/electric_sieve/ElectricSieve.py similarity index 94% rename from scale_sieve/ScaleSieve.py rename to electric_sieve/ElectricSieve.py index d7c2420..e107dd1 100644 --- a/scale_sieve/ScaleSieve.py +++ b/electric_sieve/ElectricSieve.py @@ -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/scale_sieve/__init__.py b/electric_sieve/__init__.py similarity index 100% rename from scale_sieve/__init__.py rename to electric_sieve/__init__.py diff --git a/scale_sieve/pgfw/Animation.py b/electric_sieve/pgfw/Animation.py similarity index 100% rename from scale_sieve/pgfw/Animation.py rename to electric_sieve/pgfw/Animation.py diff --git a/scale_sieve/pgfw/Audio.py b/electric_sieve/pgfw/Audio.py similarity index 100% rename from scale_sieve/pgfw/Audio.py rename to electric_sieve/pgfw/Audio.py diff --git a/scale_sieve/pgfw/Configuration.py b/electric_sieve/pgfw/Configuration.py similarity index 100% rename from scale_sieve/pgfw/Configuration.py rename to electric_sieve/pgfw/Configuration.py diff --git a/scale_sieve/pgfw/Delegate.py b/electric_sieve/pgfw/Delegate.py similarity index 100% rename from scale_sieve/pgfw/Delegate.py rename to electric_sieve/pgfw/Delegate.py diff --git a/scale_sieve/pgfw/Display.py b/electric_sieve/pgfw/Display.py similarity index 100% rename from scale_sieve/pgfw/Display.py rename to electric_sieve/pgfw/Display.py diff --git a/scale_sieve/pgfw/Game.py b/electric_sieve/pgfw/Game.py similarity index 100% rename from scale_sieve/pgfw/Game.py rename to electric_sieve/pgfw/Game.py diff --git a/scale_sieve/pgfw/GameChild.py b/electric_sieve/pgfw/GameChild.py similarity index 100% rename from scale_sieve/pgfw/GameChild.py rename to electric_sieve/pgfw/GameChild.py diff --git a/scale_sieve/pgfw/Input.py b/electric_sieve/pgfw/Input.py similarity index 100% rename from scale_sieve/pgfw/Input.py rename to electric_sieve/pgfw/Input.py diff --git a/scale_sieve/pgfw/Interpolator.py b/electric_sieve/pgfw/Interpolator.py similarity index 100% rename from scale_sieve/pgfw/Interpolator.py rename to electric_sieve/pgfw/Interpolator.py diff --git a/scale_sieve/pgfw/Mainloop.py b/electric_sieve/pgfw/Mainloop.py similarity index 100% rename from scale_sieve/pgfw/Mainloop.py rename to electric_sieve/pgfw/Mainloop.py diff --git a/scale_sieve/pgfw/Profile.py b/electric_sieve/pgfw/Profile.py similarity index 100% rename from scale_sieve/pgfw/Profile.py rename to electric_sieve/pgfw/Profile.py diff --git a/scale_sieve/pgfw/ScreenGrabber.py b/electric_sieve/pgfw/ScreenGrabber.py similarity index 100% rename from scale_sieve/pgfw/ScreenGrabber.py rename to electric_sieve/pgfw/ScreenGrabber.py diff --git a/scale_sieve/pgfw/Setup.py b/electric_sieve/pgfw/Setup.py similarity index 100% rename from scale_sieve/pgfw/Setup.py rename to electric_sieve/pgfw/Setup.py diff --git a/scale_sieve/pgfw/SetupWin.py b/electric_sieve/pgfw/SetupWin.py similarity index 100% rename from scale_sieve/pgfw/SetupWin.py rename to electric_sieve/pgfw/SetupWin.py diff --git a/scale_sieve/pgfw/Sprite.py b/electric_sieve/pgfw/Sprite.py similarity index 100% rename from scale_sieve/pgfw/Sprite.py rename to electric_sieve/pgfw/Sprite.py diff --git a/scale_sieve/pgfw/TimeFilter.py b/electric_sieve/pgfw/TimeFilter.py similarity index 100% rename from scale_sieve/pgfw/TimeFilter.py rename to electric_sieve/pgfw/TimeFilter.py diff --git a/scale_sieve/pgfw/Vector.py b/electric_sieve/pgfw/Vector.py similarity index 100% rename from scale_sieve/pgfw/Vector.py rename to electric_sieve/pgfw/Vector.py diff --git a/scale_sieve/pgfw/VideoRecorder.py b/electric_sieve/pgfw/VideoRecorder.py similarity index 100% rename from scale_sieve/pgfw/VideoRecorder.py rename to electric_sieve/pgfw/VideoRecorder.py diff --git a/scale_sieve/pgfw/__init__.py b/electric_sieve/pgfw/__init__.py similarity index 100% rename from scale_sieve/pgfw/__init__.py rename to electric_sieve/pgfw/__init__.py diff --git a/resource/aud/0Sj-99_Em.wav b/resource/aud/0Sj-99_Em.wav new file mode 100644 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 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 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 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 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 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 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 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 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 index 0000000..455a5fc --- /dev/null +++ b/resource/high-scores @@ -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