Skip to content
This repository has been archived by the owner on Feb 18, 2025. It is now read-only.

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Virashu committed Feb 20, 2024
1 parent dc5c063 commit ab2dd8c
Showing 1 changed file with 27 additions and 10 deletions.
37 changes: 27 additions & 10 deletions danmaku/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,13 @@

def run_game(is_new: bool):
"Game exit handling"
game = Game(width=WIDTH, height=HEIGHT, title="Danmaku | Game", tickrate=TICKRATE,
fullscreen=get_settings()["fullscreen"]["value"])
game = Game(
width=WIDTH,
height=HEIGHT,
title="Danmaku | Game",
tickrate=TICKRATE,
fullscreen=get_settings()["fullscreen"]["value"],
)
game.new_game = is_new
runner.run(game)

Expand All @@ -30,7 +35,7 @@ def run_game(is_new: bool):
height=HEIGHT,
title="Danmaku | Game Over",
tickrate=TICKRATE,
fullscreen=get_settings()["fullscreen"]["value"]
fullscreen=get_settings()["fullscreen"]["value"],
)
end.set("You win", (30, 157, 214), "sounds/win.wav")
runner.run(end)
Expand All @@ -40,24 +45,36 @@ def run_game(is_new: bool):
height=HEIGHT,
title="Danmaku | Game Over",
tickrate=TICKRATE,
fullscreen=get_settings()["fullscreen"]["value"]
fullscreen=get_settings()["fullscreen"]["value"],
)
end.set("Game over", (30, 157, 214), "sounds/lose.wav")
runner.run(end)


while runner.running:
menu = Menu(width=WIDTH, height=HEIGHT, title="Danmaku | Menu",
fullscreen=get_settings()["fullscreen"]["value"])
menu = Menu(
width=WIDTH,
height=HEIGHT,
title="Danmaku | Menu",
fullscreen=get_settings()["fullscreen"]["value"],
)
runner.run(menu)
match menu.exit_status:
case "game", new_game:
run_game(new_game)
case "settings":
settings = Settings(width=WIDTH, height=HEIGHT, title="Danmaku | Settings",
fullscreen=get_settings()["fullscreen"]["value"])
settings = Settings(
width=WIDTH,
height=HEIGHT,
title="Danmaku | Settings",
fullscreen=get_settings()["fullscreen"]["value"],
)
runner.run(settings)
case "history":
history = History(width=WIDTH, height=HEIGHT, title="Danmaku | History",
fullscreen=get_settings()["fullscreen"]["value"])
history = History(
width=WIDTH,
height=HEIGHT,
title="Danmaku | History",
fullscreen=get_settings()["fullscreen"]["value"],
)
runner.run(history)

0 comments on commit ab2dd8c

Please sign in to comment.