From 9b6d5e5af271b4afb973c080df45ebfde22dad63 Mon Sep 17 00:00:00 2001 From: Frank DeMarco Date: Thu, 29 Oct 2020 13:40:05 -0400 Subject: [PATCH] gif alpha and timing config options --- NS.py | 16 +++++++++++----- config | 3 +++ 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/NS.py b/NS.py index c12a8eb..d6616e5 100644 --- a/NS.py +++ b/NS.py @@ -52,11 +52,16 @@ class NS(Game, Animation): { "time": { - "int": ["timer-max-time", "timer-start-time", "timer-addition", "sword-delay"] + "int": ["timer-max-time", "timer-start-time", "timer-addition", "sword-delay", + "attract-gif-length", "attract-board-length"] }, "input": { "bool": "serial" + }, + "display": + { + "float": "attract-gif-alpha" } }) Animation.__init__(self, self) @@ -391,8 +396,9 @@ class Video(Sprite): self.gif = self.gifs[1] self.mask = Surface([diameter] * 2, SRCALPHA) rect = self.mask.get_rect() - filled_circle(self.mask, rect.centerx, rect.centery, rect.centerx, (0, 0, 0)) - filled_circle(self.mask, rect.centerx, rect.centery, rect.centerx - 2, (255, 255, 255)) + alpha = int(self.get_configuration("display", "attract-gif-alpha") * 255) + filled_circle(self.mask, rect.centerx, rect.centery, rect.centerx, (0, 0, 0, alpha)) + filled_circle(self.mask, rect.centerx, rect.centery, rect.centerx - 2, (255, 255, 255, alpha)) self.add_frame(self.mask) self.play() @@ -521,13 +527,13 @@ class Title(Animation): def show_video(self): self.video.unhide() - self.play(self.hide_video, delay=21000, play_once=True) + self.play(self.hide_video, delay=self.get_configuration("time", "attract-gif-length"), play_once=True) self.get_game().tony.set_frameset("static") self.reset() def hide_video(self): self.video.hide() - self.play(self.show_video, delay=10000, play_once=True) + self.play(self.show_video, delay=self.get_configuration("time", "attract-board-length"), play_once=True) self.get_game().tony.set_frameset("board") def update(self): diff --git a/config b/config index 04b1bcd..6556589 100644 --- a/config +++ b/config @@ -12,6 +12,7 @@ caption = Scrapeboard show-framerate = no dimensions = 640, 480 fullscreen = no +attract-gif-alpha = .95 [mouse] visible = False @@ -33,3 +34,5 @@ timer-max-time = 10000 timer-start-time = 7000 timer-addition = 1000 sword-delay = 300 +attract-gif-length = 10000 +attract-board-length = 4000