totals and initials advance automatically
This commit is contained in:
parent
f0328cd5ad
commit
676f2a392b
10
config
10
config
|
@ -1,10 +1,10 @@
|
|||
[setup]
|
||||
title = Electric Sieve
|
||||
title = iBitFit
|
||||
url = https://shampoo.ooo
|
||||
contact-email = mailbox@shampoo.ooo
|
||||
contact-name = Frank DeMarco
|
||||
summary = UFOs fracking your skull in 1920s America
|
||||
version = 0.1.1
|
||||
summary = thank you
|
||||
version = 0.12345.0
|
||||
license = Public Domain
|
||||
platform = Linux
|
||||
package-root = electric_sieve
|
||||
|
@ -12,7 +12,6 @@ init-script = electric-sieve
|
|||
|
||||
[display]
|
||||
caption = iBITFIT
|
||||
#dimensions = 420, 700
|
||||
dimensions = 480, 720
|
||||
score-font-path = font/Titan-One.ttf
|
||||
title-font-path = font/Oxygen.ttf
|
||||
|
@ -27,6 +26,7 @@ visible = no
|
|||
[input]
|
||||
title-hold = 2000
|
||||
initials-hold = 1000
|
||||
initials-idle = 30000
|
||||
|
||||
[keys]
|
||||
quit = K_ESCAPE
|
||||
|
@ -43,7 +43,7 @@ path = high-scores
|
|||
[audio]
|
||||
title = aud/Meld.ogg
|
||||
title-advance = aud/It.wav
|
||||
title-fade = 30000
|
||||
title-fade = 19000
|
||||
triangles = aud/777.ogg
|
||||
hit = aud/Skinball.wav
|
||||
miss = aud/0Sj-99_Em.wav
|
||||
|
|
|
@ -49,7 +49,7 @@ class ElectricSieve(Game):
|
|||
},
|
||||
"input":
|
||||
{
|
||||
"int": ["title-hold", "initials-hold"]
|
||||
"int": ["title-hold", "initials-hold", "initials-idle"]
|
||||
},
|
||||
"audio":
|
||||
{
|
||||
|
@ -306,7 +306,7 @@ class Title(GameChild):
|
|||
self.holding_button_elapsed += self.get_game().time_filter.get_last_frame_duration()
|
||||
logo = Sprite(self)
|
||||
font = pygame.font.Font(self.get_resource("terminus/TerminusItalic.ttf"),
|
||||
62 + int(self.holding_button_elapsed / self.get_configuration("input", "title-hold") * 72))
|
||||
62 - int(self.holding_button_elapsed / self.get_configuration("input", "title-hold") * 38))
|
||||
logo.add_frame(self.get_game().orient(font.render("iBITFIT", True, pygame.Color(0, 0, 0), pygame.Color(255, 255, 255))))
|
||||
if not self.get_game().rotated:
|
||||
logo.location.midtop = self.get_display_surface().get_rect().midtop
|
||||
|
@ -778,6 +778,7 @@ class Static(Sprite):
|
|||
|
||||
def __init__(self, parent):
|
||||
Sprite.__init__(self, parent, 120)
|
||||
self.advance_automatically = 0
|
||||
self.noise = Sound(self.get_resource("audio", "noise"))
|
||||
self.end = Sound(self.get_resource("audio", "end"))
|
||||
self.deactivate()
|
||||
|
@ -787,13 +788,13 @@ class Static(Sprite):
|
|||
self.initials = Initials(self)
|
||||
self.reset()
|
||||
self.add_frames()
|
||||
self.subscribe(self.respond)
|
||||
|
||||
def deactivate(self):
|
||||
self.active = False
|
||||
self.end.fadeout(500)
|
||||
|
||||
def reset(self):
|
||||
self.advance_automatically = 0
|
||||
self.complete = False
|
||||
self.intensity = 0
|
||||
self.noise.set_volume(0)
|
||||
|
@ -822,17 +823,6 @@ class Static(Sprite):
|
|||
frame.blit(choice(tiles), (x, y))
|
||||
self.add_frame(frame)
|
||||
|
||||
def respond(self, event):
|
||||
if self.active and self.complete and not self.initials.active:
|
||||
if self.delegate.compare(event, "left") or self.delegate.compare(event, "right"):
|
||||
if self.get_game().triangles.score > self.get_game().title.scoreboard.get_scores()[Scoreboard.SCORE_COUNT - 1][1]:
|
||||
self.total.deactivate()
|
||||
self.initials.activate()
|
||||
else:
|
||||
self.finish(wipe=True)
|
||||
self.get_delegate().cancel_propagation()
|
||||
self.get_game().suppress_input_temporarily(500)
|
||||
|
||||
def finish(self, text="---", wipe=False):
|
||||
if wipe:
|
||||
self.parent.title.scoreboard.most_recent_score = None
|
||||
|
@ -877,6 +867,17 @@ class Static(Sprite):
|
|||
self.intensity *= .998
|
||||
self.increaser.update()
|
||||
self.noise.set_volume(self.intensity)
|
||||
if self.total.active:
|
||||
if self.advance_automatically > 3000:
|
||||
self.advance_automatically = 0
|
||||
if self.get_game().triangles.score > self.get_game().title.scoreboard.get_scores()[Scoreboard.SCORE_COUNT - 1][1]:
|
||||
self.total.deactivate()
|
||||
self.initials.activate()
|
||||
self.get_game().suppress_input_temporarily(500)
|
||||
else:
|
||||
self.finish(wipe=True)
|
||||
else:
|
||||
self.advance_automatically += self.get_game().time_filter.get_last_frame_duration()
|
||||
if self.intensity > .1:
|
||||
Sprite.update(self)
|
||||
self.total.update()
|
||||
|
@ -907,6 +908,7 @@ class Initials(GameChild):
|
|||
self.subscribe(self.respond)
|
||||
|
||||
def reset(self):
|
||||
self.idle_time = 0
|
||||
self.text = "---"
|
||||
self.index = 0
|
||||
self.holding_button = False
|
||||
|
@ -917,6 +919,7 @@ class Initials(GameChild):
|
|||
|
||||
def respond(self, event):
|
||||
if self.active:
|
||||
self.idle_time = 0
|
||||
compare = self.get_game().delegate.compare
|
||||
if compare(event, "right", cancel=False):
|
||||
self.holding_button = True
|
||||
|
@ -945,9 +948,19 @@ class Initials(GameChild):
|
|||
|
||||
def activate(self):
|
||||
self.active = True
|
||||
self.idle_time = 0
|
||||
|
||||
def submit(self):
|
||||
self.deactivate()
|
||||
self.parent.finish(self.text)
|
||||
self.reset()
|
||||
|
||||
def update(self):
|
||||
if self.active:
|
||||
if self.idle_time > self.get_configuration("input", "initials-idle"):
|
||||
self.submit()
|
||||
else:
|
||||
self.idle_time += self.get_game().time_filter.get_last_frame_duration()
|
||||
ds = self.get_display_surface()
|
||||
self.button_prompt.update()
|
||||
if self.holding_button:
|
||||
|
@ -955,9 +968,7 @@ class Initials(GameChild):
|
|||
if self.holding_button_elapsed > self.get_configuration("input", "initials-hold"):
|
||||
self.index += 1
|
||||
if self.index == len(self.text):
|
||||
self.deactivate()
|
||||
self.parent.finish(self.text)
|
||||
self.reset()
|
||||
self.submit()
|
||||
else:
|
||||
self.holding_button = False
|
||||
self.holding_button_elapsed = 0
|
||||
|
|
|
@ -23,7 +23,7 @@ class Plate(GameChild, Surface):
|
|||
background = Surface((width, height))
|
||||
color = Color(0, 0, 0)
|
||||
for y in range(height):
|
||||
hue = abs(int(float(y) / (height) * 240) - 120)
|
||||
hue = abs(int(float(y) / (height) * 80) - 40) + 280
|
||||
color.hsva = hue, 100, 40, 100
|
||||
background.fill(color, (0, y, width, 1))
|
||||
self.background = background
|
||||
|
|
Loading…
Reference in New Issue