This commit is contained in:
Frank DeMarco 2014-04-28 10:34:10 +09:00
parent 935f87a89b
commit e3705dafe5
35 changed files with 147 additions and 9 deletions

1
.gitignore vendored
View File

@ -1 +1,2 @@
*.pyc
resource/local/

92
OFL.txt Normal file
View File

@ -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.

13
config
View File

@ -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

View File

@ -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()

View 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()

BIN
resource/aud/0Sj-99_Em.wav Normal file

Binary file not shown.

BIN
resource/aud/777.ogg Normal file

Binary file not shown.

BIN
resource/aud/Heat.ogg Normal file

Binary file not shown.

BIN
resource/aud/It.wav Normal file

Binary file not shown.

BIN
resource/aud/Meld.ogg Normal file

Binary file not shown.

Binary file not shown.

BIN
resource/aud/Skinball.wav Normal file

Binary file not shown.

Binary file not shown.

BIN
resource/font/Titan-One.ttf Normal file

Binary file not shown.

16
resource/high-scores Normal file
View File

@ -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