Skip to content

Commit

Permalink
fix several bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
Teru Kaazhooft committed Oct 6, 2023
1 parent 9f5da4d commit 488678a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 13 deletions.
13 changes: 7 additions & 6 deletions flashbox.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""
Flashbox v0.7 by Chromatic Vision. For more, visit https://chromatic-vision.github.io/flashbox
Flashbox v0.8 by Chromatic Vision. For more, visit https://chromatic-vision.github.io/flashbox
"""

Expand All @@ -19,21 +19,22 @@
import abacus
import logger

VERSION = "v0.7"
VERSION = "v0.8"

def smash():
pass


class Flashbox:

def __init__(self, screen: pygame.Surface):
def __init__(self):

self.config_file = "config.json"

self.run = 1
self.screen = screen
self.size = screen.get_size()
self.screen = pygame.display.set_mode((0, 0), pygame.RESIZABLE)
self.screen = pygame.display.set_mode((0, 0), pygame.RESIZABLE)
self.size = self.screen.get_size()

self.buttons = [
Flashbox.Button(self, self.size[0] - 116, 5, 50, 50, 0, "!"),
Expand Down Expand Up @@ -246,7 +247,7 @@ def update_time(self):
if self.phase == 0:

if pygame.key.get_pressed()[pygame.K_m]:
if self.t % 80 == 0:
if self.t % 80 == 0 and self.seconds - 0.01 > 0:
self.seconds -= 0.01

if pygame.key.get_pressed()[pygame.K_SLASH]:
Expand Down
8 changes: 1 addition & 7 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,11 @@
pygame.mixer.init()
pygame.init()

size = (0, 0)
screen = pygame.display.set_mode(size, pygame.RESIZABLE)
size = screen.get_size()

f = flashbox.Flashbox(screen)
f = flashbox.Flashbox()

FPS = 120
clock = pygame.time.Clock()

logger.log(f"Screen size: {size[0]}, {size[1]}")

pygame.event.set_allowed([pygame.QUIT, pygame.KEYDOWN, pygame.TEXTINPUT, pygame.MOUSEBUTTONUP])
pygame.display.set_caption(f"Flashbox {flashbox.VERSION}")
pygame.display.set_icon(pygame.image.load("images/flashbox.ico"))
Expand Down

0 comments on commit 488678a

Please sign in to comment.