diff --git a/bottleblaster/sounds/empty.wav b/bottleblaster/sounds/empty.wav new file mode 100644 index 0000000..657ce69 Binary files /dev/null and b/bottleblaster/sounds/empty.wav differ diff --git a/numnastics/numnastics.py.bak b/numnastics/numnastics.py.bak new file mode 100755 index 0000000..2d83f28 --- /dev/null +++ b/numnastics/numnastics.py.bak @@ -0,0 +1,64 @@ +#!/bin/python +# -*- coding: utf-8 -*- + +from storm_games import * + +# Initial variable settings +mode = "menu" +sounds = initialize_gui("Numnastics") + +def game(mode): + i = 0 + startTime = time.time() + tries = 0 + numberList = list("123456789") + random.shuffle(numberList) + while ''.join(numberList) != "123456789": + event = pygame.event.wait() + if event.type == pygame.KEYDOWN: + # 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 mode != "menu": + mode = "menu" + return mode + elif mode == "menu": exit_game() + elif event.key in [pygame.K_1, pygame.K_2, pygame.K_3, pygame.K_4, pygame.K_5, pygame.K_6,pygame.K_7, pygame.K_8, pygame.K_9]: + i = numberList.index((pygame.key.name(event.key))) + speak(numberList[i]) + elif event.key in [pygame.K_LEFT, pygame.K_UP]: + if i > 0: i = i - 1 + speak(numberList[i]) + elif event.key in [pygame.K_RIGHT, pygame.K_DOWN]: + if i < len(numberList) - 1: i = i + 1 + speak(numberList[i]) + elif event.key == pygame.K_SPACE: + speak(str(' '.join(numberList[i:len(numberList)]))) + continue + elif event.key == pygame.K_RETURN: + if i != -1: + reversedNumberList = numberList[i:len(numberList)] + reversedNumberList.reverse() + del numberList[i:len(numberList)] + numberList.extend(reversedNumberList) + tries = tries + 1 + sounds['flip'].play() + speak(str(' '.join(numberList[i:len(numberList)]))) + else: + i = -1 + sounds['error'].play() + endTime = round(time.time() - startTime, 2) + message = [ + "Congratulations! You beat Numnastics in " + str(tries) + " tries.",\ + "Your time was " + str(endTime) + " seconds."] + display_message(message) + sounds['win'].play() + time.sleep(sounds['win'].get_length()) + return "menu" + +# Game starts at main menu +mode = game_menu("start game", "instructions", "credits", "exit_game") +while True: + if mode == "menu": mode = game_menu("start game", "instructions", "credits", "exit_game") + if mode == "start game": mode = game(mode) + time.sleep(.001) + diff --git a/sounds-abound/sounds-abound b/sounds-abound/sounds-abound index 69cc859..cb56e77 100755 --- a/sounds-abound/sounds-abound +++ b/sounds-abound/sounds-abound @@ -37,11 +37,14 @@ eval play -q ${sequence} norm -5 sleep .5 unset guess i=0 +ifs="$IFS" +unset IFS while [ -z "${guess}" ]; do play -nqV0 synth .2 sq E4 pad .3 norm -5 & -read -sn1 -t .6 guess +read -sn1 -t .6 guess && guess=" " ((i++)) done +IFS="$ifs" if [ $i -eq $length ]; then echo "you win!" else diff --git a/soxsynth.tar.gz b/soxsynth.tar.gz deleted file mode 100644 index 19337a0..0000000 Binary files a/soxsynth.tar.gz and /dev/null differ diff --git a/yahtzee.tar.gz b/yahtzee.tar.gz deleted file mode 100644 index 28ee82a..0000000 Binary files a/yahtzee.tar.gz and /dev/null differ