diff --git a/mine-racer/__pycache__/storm_games.cpython-35.pyc b/mine-racer/__pycache__/storm_games.cpython-35.pyc index e599415..8d8024a 100644 Binary files a/mine-racer/__pycache__/storm_games.cpython-35.pyc and b/mine-racer/__pycache__/storm_games.cpython-35.pyc differ diff --git a/mine-racer/sounds/bottle.ogg b/mine-racer/sounds/bottle.ogg deleted file mode 100644 index d107835..0000000 Binary files a/mine-racer/sounds/bottle.ogg and /dev/null differ diff --git a/mine-racer/sounds/empty.ogg b/mine-racer/sounds/empty.ogg deleted file mode 100644 index a18f5be..0000000 Binary files a/mine-racer/sounds/empty.ogg and /dev/null differ diff --git a/mine-racer/sounds/glass1.ogg b/mine-racer/sounds/glass1.ogg deleted file mode 100644 index 8a6a183..0000000 Binary files a/mine-racer/sounds/glass1.ogg and /dev/null differ diff --git a/mine-racer/sounds/glass2.ogg b/mine-racer/sounds/glass2.ogg deleted file mode 100644 index 5507c91..0000000 Binary files a/mine-racer/sounds/glass2.ogg and /dev/null differ diff --git a/mine-racer/sounds/glass3.ogg b/mine-racer/sounds/glass3.ogg deleted file mode 100644 index 8698ebf..0000000 Binary files a/mine-racer/sounds/glass3.ogg and /dev/null differ diff --git a/mine-racer/sounds/gun1.ogg b/mine-racer/sounds/gun1.ogg deleted file mode 100644 index b9fbf3e..0000000 Binary files a/mine-racer/sounds/gun1.ogg and /dev/null differ diff --git a/mine-racer/sounds/gun2.ogg b/mine-racer/sounds/gun2.ogg deleted file mode 100644 index 41ca37d..0000000 Binary files a/mine-racer/sounds/gun2.ogg and /dev/null differ diff --git a/mine-racer/sounds/gun3.ogg b/mine-racer/sounds/gun3.ogg deleted file mode 100644 index 87de4f1..0000000 Binary files a/mine-racer/sounds/gun3.ogg and /dev/null differ diff --git a/mine-racer/sounds/gun4.ogg b/mine-racer/sounds/gun4.ogg deleted file mode 100644 index 52953b3..0000000 Binary files a/mine-racer/sounds/gun4.ogg and /dev/null differ diff --git a/mine-racer/sounds/gun5.ogg b/mine-racer/sounds/gun5.ogg deleted file mode 100644 index d05e1e1..0000000 Binary files a/mine-racer/sounds/gun5.ogg and /dev/null differ diff --git a/mine-racer/sounds/jump.ogg b/mine-racer/sounds/jump.ogg new file mode 100644 index 0000000..3676b94 Binary files /dev/null and b/mine-racer/sounds/jump.ogg differ diff --git a/mine-racer/sounds/load3.ogg b/mine-racer/sounds/load3.ogg deleted file mode 100644 index af7819c..0000000 Binary files a/mine-racer/sounds/load3.ogg and /dev/null differ diff --git a/mine-racer/sounds/load4.ogg b/mine-racer/sounds/load4.ogg deleted file mode 100644 index af7819c..0000000 Binary files a/mine-racer/sounds/load4.ogg and /dev/null differ diff --git a/mine-racer/sounds/load5.ogg b/mine-racer/sounds/load5.ogg deleted file mode 100644 index 0ff00a4..0000000 Binary files a/mine-racer/sounds/load5.ogg and /dev/null differ diff --git a/mine-racer/sounds/music_car.ogg b/mine-racer/sounds/music_car.ogg new file mode 100644 index 0000000..963f8fa Binary files /dev/null and b/mine-racer/sounds/music_car.ogg differ diff --git a/mine-racer/sounds/music_menu.ogg b/mine-racer/sounds/music_menu.ogg new file mode 100644 index 0000000..b6a7fb9 Binary files /dev/null and b/mine-racer/sounds/music_menu.ogg differ diff --git a/mine-racer/storm_games.py b/mine-racer/storm_games.py index aef6cbc..645a11c 100755 --- a/mine-racer/storm_games.py +++ b/mine-racer/storm_games.py @@ -9,9 +9,7 @@ import pygame import speechd import time -def __init__(): - spd = speechd.Client() - +spd = speechd.Client() def speak(text, interupt = True): if interupt == True: spd.cancel() spd.say(text) @@ -37,3 +35,20 @@ def initialize_gui(gameTitle): time.sleep(soundData['game-intro'].get_length()) return soundData +def game_menu(*options): + loop = True + pygame.mixer.music.load("sounds/music_menu.ogg") + pygame.mixer.music.play(-1) + i = 0 + speak(options[i]) + while loop == True: + event = pygame.event.wait() + if event.key == pygame.K_ESCAPE: exit_game() + if event.key == pygame.K_DOWN and i < len(options) - 1: + i = i + 1 + speak(options[i]) + if event.key == pygame.K_UP and i > 0: + i = i - 1 + speak(options[i]) + event = pygame.event.clear() + time.sleep(0.001) diff --git a/pybottle/__pycache__/storm_games.cpython-35.pyc b/pybottle/__pycache__/storm_games.cpython-35.pyc deleted file mode 100644 index d907a41..0000000 Binary files a/pybottle/__pycache__/storm_games.cpython-35.pyc and /dev/null differ diff --git a/pybottle/bottle-blaster.py b/pybottle/bottle-blaster.py index 62351c4..c9b8f8f 100755 --- a/pybottle/bottle-blaster.py +++ b/pybottle/bottle-blaster.py @@ -13,6 +13,7 @@ while True: # if the event is about a keyboard button that have been pressed... if event.type == pygame.KEYDOWN: sounds['bottle'].play(-1) + speak("This is a test.") if event.type == pygame.KEYUP: sounds['bottle'].stop() # and if the button is the "q" letter or the "escape" key... diff --git a/pybottle/storm_games.py b/pybottle/storm_games.py index b5c631f..a72c20d 100755 --- a/pybottle/storm_games.py +++ b/pybottle/storm_games.py @@ -2,13 +2,17 @@ # -*- coding: utf-8 -*- """Standard initializations and functions shared by all games.""" +from espeak import espeak import os from os import listdir from os.path import isfile, join import pygame import time -SoundFolder = 'sounds' +def speak(text, interupt = True): + if interupt == True: espeak.cancel() + espeak.set_voice("en-us") + espeak.synth(text) def initialize_gui(gameTitle): # start pygame