From 52766667cf896545b59633affce8269842813659 Mon Sep 17 00:00:00 2001 From: mollusk Date: Wed, 22 May 2019 04:53:22 -0700 Subject: [PATCH] respect python formatting guidelines --- main.py | 39 +++++++++++++++++++++------------------ 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/main.py b/main.py index 214ffd1..0e2140b 100755 --- a/main.py +++ b/main.py @@ -1,36 +1,42 @@ #!/usr/bin/python3 import contextlib -with contextlib.redirect_stdout(None): #hide pygame welcome message +with contextlib.redirect_stdout(None): # hide Pygame welcome message - import os, sys, pygame + import os + import sys + import pygame -def confirmLeave(): +def confirm_leave(): prompt = input("All progress will be lost, are you sure?: [y/N]: ") if prompt == "n": print("Staying in game") elif prompt == "y": - mainMenu() + main_menu() else: print("That is not an option") -def navBar(): + +def nav_bar(): + print(""" ============================ [m] - Main Menu ============================ """) -def clear(): - os.system("clear") # Windows has no clear screen equivilent so use os.system -def lvlOne(): +def clear(): + os.system("clear") # Windows has no clear screen equivalent so use os.system + + +def lvl_one(): clear() - navBar() + nav_bar() while True: print(""" @@ -50,7 +56,7 @@ def lvlOne(): prompt = input(">> ") if prompt == "m": - confirmLeave() + confirm_leave() elif prompt == "q": sys.exit(0) @@ -59,13 +65,12 @@ def lvlOne(): print("That key is not an option") - -def mainMenu(): +def main_menu(): clear() pygame.init() - theme = pygame.mixer.music.load("big-booty-judy-drums.mp3") + theme = pygame.mixer.music.load("big-booty-judy-drums.ogg") pygame.mixer.music.play(loops=-1, start=0.0) - while 1==1: + while 1 == 1: print(""" ____ _ ____ __ _ __ / __ )(_)___ _ / __ )____ ____ / /___ __ (_)_ ______/ /_ __ @@ -105,13 +110,11 @@ def mainMenu(): if prompt == "s": pygame.mixer.music.stop() pygame.quit() - lvlOne() + lvl_one() elif prompt == "q": pygame.quit() sys.exit(0) - - -mainMenu() \ No newline at end of file +main_menu()