variable for how long before the title screen unlock resets from no input

This commit is contained in:
frank 2022-01-28 12:14:08 -05:00
parent b099c97871
commit 7036ea9ed0
2 changed files with 9 additions and 2 deletions

10
NS.py
View File

@ -68,7 +68,7 @@ class NS(Game, Animation):
"time":
{
"int": ["timer-max-time", "timer-start-time", "timer-addition", "sword-delay",
"attract-gif-length", "attract-board-length"]
"attract-gif-length", "attract-board-length", "attract-reset-countdown"]
},
"input":
{
@ -520,6 +520,9 @@ class Logo(Sprite):
class Title(Animation):
"""
Handles displaying and drawing the title screen.
"""
UNLOCK_MOVES = NS.NW, NS.N, NS.NE, NS.NW
@ -649,11 +652,14 @@ class Title(Animation):
self.video.move(dy=dsr.top - self.video.location.top)
dx, dy = get_delta(self.angle, 5, False)
self.video.move(dx, dy)
# Hide GIFs/attract mode (or keep them hidden) if input is detected. Set a countdown that will turn
# attract mode back on if no input is detected before the countdown expires. As long as input keeps
# being detected, this block will keep running and restarting the countdown.
if platform.get_pressed():
self.video.hide()
self.get_game().tony.set_frameset("static")
self.halt()
self.play(self.show_video, delay=10000, play_once=True)
self.play(self.show_video, delay=self.get_configuration("time", "attract-reset-countdown"), play_once=True)
self.video.update()
self.draw_scores()

1
config
View File

@ -43,6 +43,7 @@ timer-addition = 1000
sword-delay = 300
attract-gif-length = 10000
attract-board-length = 3600
attract-reset-countdown = 30000
[bgm]
title = resource/bgm/title.ogg, .65