respect python formatting guidelines

This commit is contained in:
mollusk 2019-05-22 04:53:22 -07:00
parent 0a1cae4d45
commit 52766667cf

39
main.py
View File

@ -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()
main_menu()