Got rid of that nasty dos formatting lol.

This commit is contained in:
Storm dragon 2016-03-23 17:50:03 -04:00
parent fe3a2102bd
commit 1f81fb4ee1
2 changed files with 39 additions and 37 deletions

View File

@ -1,37 +1,37 @@
#!/bin/python #!/bin/python
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from storm_games import * from storm_games import *
# Initial variable settings # Initial variable settings
mode = "menu" mode = "menu"
sounds = initialize_gui("Mine Racer") sounds = initialize_gui("Mine Racer")
def game(): def game():
pygame.mixer.music.load("sounds/music_car.ogg") pygame.mixer.music.load("sounds/music_car.ogg")
gameOver = False gameOver = False
jump = False jump = False
points = 0 points = 0
position = 0 position = 0
while not gameOver: while not gameOver:
if pygame.mixer.music.get_busy() == 0 and jump == False: pygame.mixer.music.play(-1) if pygame.mixer.music.get_busy() == 0 and jump == False: pygame.mixer.music.play(-1)
event = pygame.event.wait() event = pygame.event.wait()
time.sleep(10) time.sleep(10)
exit_game() exit_game()
# Game starts at main menu # Game starts at main menu
mode = game_menu("start game", "credits", "exit_game") mode = game_menu("start game", "credits", "exit_game")
while True: while True:
# wait for an event # wait for an event
event = pygame.event.wait() event = pygame.event.wait()
# if the event is about a keyboard button that have been pressed... # if the event is about a keyboard button that have been pressed...
if event.type == pygame.KEYDOWN: if event.type == pygame.KEYDOWN:
# Escape is the back/exit key, close the game if not playing, or return to menu if playing. # Escape is the back/exit key, close the game if not playing, or return to menu if playing.
if event.key == pygame.K_ESCAPE: if event.key == pygame.K_ESCAPE:
if mode != "menu": mode = "menu" if mode != "menu": mode = "menu"
if mode == "menu": exit_game() if mode == "menu": exit_game()
# Call the game menu, if needed. # Call the game menu, if needed.
if mode == "menu": mode = game_menu("start game", "credits", "exit_game") if mode == "menu": mode = game_menu("start game", "credits", "exit_game")
if mode == "start game": game() if mode == "start game": game()
time.sleep(.001) time.sleep(.001)

View File

@ -53,6 +53,8 @@ def game_menu(*options):
eval(options[i] + "()") eval(options[i] + "()")
continue continue
except: except:
pygame.mixer.music.fadeout(500)
time.sleep(0.25)
return options[i] return options[i]
continue continue
speak(options[i]) speak(options[i])