menu system in progress. Sounds for game added. More to come.
This commit is contained in:
Binary file not shown.
@ -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...
|
||||
|
@ -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
|
||||
|
Reference in New Issue
Block a user