Compare commits
1 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
190cc98aa1 |
@ -1,7 +1,4 @@
|
||||
storm-games
|
||||
===========
|
||||
|
||||
A collection of command line games, accessible to the blind, playable by all.
|
||||
|
||||
<script src="https://liberapay.com/stormdragon2976/widgets/button.js"></script>
|
||||
<noscript><a href="https://liberapay.com/stormdragon2976/donate"><img alt="Donate using Liberapay" src="https://liberapay.com/assets/widgets/donate.svg"></a></noscript>
|
||||
A collection of games, accessible to the blind, playable by all.
|
||||
|
@ -1,10 +0,0 @@
|
||||
15 Test
|
||||
2 Fluff
|
||||
0 anonymous
|
||||
0 anonymous
|
||||
0 anonymous
|
||||
0 anonymous
|
||||
0 anonymous
|
||||
0 anonymous
|
||||
0 anonymous
|
||||
0 anonymous
|
BIN
bottleblaster/sounds/empty.wav
Normal file
BIN
bottleblaster/sounds/empty.wav
Normal file
Binary file not shown.
38
mine-racer/mine-racer.py
Executable file
38
mine-racer/mine-racer.py
Executable file
@ -0,0 +1,38 @@
|
||||
#!/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from storm_games import *
|
||||
|
||||
# Initial variable settings
|
||||
gameName = "Mine Racer"
|
||||
mode = "menu"
|
||||
sounds = initialize_gui(gameName)
|
||||
|
||||
def game():
|
||||
pygame.mixer.music.load("sounds/music_car.ogg")
|
||||
gameOver = False
|
||||
jump = False
|
||||
points = 0
|
||||
position = 0
|
||||
while not gameOver:
|
||||
if pygame.mixer.music.get_busy() == 0 and jump == False: pygame.mixer.music.play(-1)
|
||||
event = pygame.event.wait()
|
||||
time.sleep(10)
|
||||
exit_game()
|
||||
|
||||
# Game starts at main menu
|
||||
mode = game_menu("start game", "credits", "exit_game")
|
||||
while True:
|
||||
# wait for an event
|
||||
event = pygame.event.wait()
|
||||
# if the event is about a keyboard button that have been pressed...
|
||||
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"
|
||||
if mode == "menu": exit_game()
|
||||
# Call the game menu, if needed.
|
||||
if mode == "menu": mode = game_menu("start game", "credits", "exit_game")
|
||||
if mode == "start game": game()
|
||||
time.sleep(.001)
|
||||
|
BIN
mine-racer/sounds/game-intro.ogg
Normal file
BIN
mine-racer/sounds/game-intro.ogg
Normal file
Binary file not shown.
BIN
mine-racer/sounds/jump.ogg
Normal file
BIN
mine-racer/sounds/jump.ogg
Normal file
Binary file not shown.
BIN
mine-racer/sounds/music_car.ogg
Normal file
BIN
mine-racer/sounds/music_car.ogg
Normal file
Binary file not shown.
BIN
mine-racer/sounds/music_menu.ogg
Normal file
BIN
mine-racer/sounds/music_menu.ogg
Normal file
Binary file not shown.
81
mine-racer/storm_games.py
Executable file
81
mine-racer/storm_games.py
Executable file
@ -0,0 +1,81 @@
|
||||
#!/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
"""Standard initializations and functions shared by all games."""
|
||||
|
||||
import os
|
||||
from os import listdir
|
||||
from os.path import isfile, join
|
||||
from inspect import isfunction
|
||||
import pygame
|
||||
import speechd
|
||||
import time
|
||||
|
||||
spd = speechd.Client()
|
||||
def speak(text, interupt = True):
|
||||
if interupt == True: spd.cancel()
|
||||
spd.say(text)
|
||||
|
||||
def exit_game():
|
||||
spd.close()
|
||||
pygame.quit()
|
||||
exit()
|
||||
|
||||
def initialize_gui(gameTitle):
|
||||
# start pygame
|
||||
pygame.init()
|
||||
# start the display (required by the event loop)
|
||||
pygame.display.set_mode((320, 200))
|
||||
pygame.display.set_caption(gameTitle)
|
||||
# Load sounds from the sound directory and creates a list like that {'bottle': 'bottle.ogg'}
|
||||
soundFiles = [f for f in listdir("sounds/") if isfile(join("sounds/", f)) and (f.split('.')[1].lower() in ["ogg","wav"])]
|
||||
#lets make a dict with pygame.mixer.Sound() objects {'bottle':<soundobject>}
|
||||
soundData = {}
|
||||
for f in soundFiles:
|
||||
soundData[f.split('.')[0]] = pygame.mixer.Sound("sounds/" + f)
|
||||
soundData['game-intro'].play()
|
||||
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.set_volume(0.75)
|
||||
pygame.mixer.music.play(-1)
|
||||
i = 0
|
||||
speak(options[i])
|
||||
while loop == True:
|
||||
event = pygame.event.wait()
|
||||
if event.type == pygame.KEYDOWN:
|
||||
if event.key == pygame.K_ESCAPE: exit_game()
|
||||
if event.key == pygame.K_DOWN and i < len(options) - 1: i = i + 1
|
||||
if event.key == pygame.K_UP and i > 0: i = i - 1
|
||||
if event.key == pygame.K_RETURN:
|
||||
try:
|
||||
eval(options[i] + "()")
|
||||
continue
|
||||
except:
|
||||
time.sleep(0.25)
|
||||
return options[i]
|
||||
continue
|
||||
speak(options[i])
|
||||
event = pygame.event.clear()
|
||||
time.sleep(0.001)
|
||||
|
||||
def credits():
|
||||
info = (
|
||||
"Mine Racer: brought to you by Storm Dragon",\
|
||||
"Billy Wolfe, designer and coder.",\
|
||||
"http://stormdragon.tk",\
|
||||
"Press escape or enter to return to the game menu.")
|
||||
i = 0
|
||||
speak(info[i])
|
||||
while True:
|
||||
event = pygame.event.wait()
|
||||
if event.type == pygame.KEYDOWN:
|
||||
if event.key == pygame.K_ESCAPE or event.key == pygame.K_RETURN: return
|
||||
if event.key == pygame.K_DOWN and i < len(info) - 1: i = i + 1
|
||||
if event.key == pygame.K_UP and i > 0: i = i - 1
|
||||
speak(info[i])
|
||||
event = pygame.event.clear()
|
||||
time.sleep(0.001)
|
||||
|
@ -9,6 +9,3 @@ TTYtter (optional)
|
||||
|
||||
Playing
|
||||
You are given a scrambled list of numbers from 1 to 9. Press the number you want to flip from, and that number, plus all the numbers after it will reverse. the object of the game is to get the numbers in the right order, 123456789, in as few tries as possible.
|
||||
|
||||
<script src="https://liberapay.com/stormdragon2976/widgets/button.js"></script>
|
||||
<noscript><a href="https://liberapay.com/stormdragon2976/donate"><img alt="Donate using Liberapay" src="https://liberapay.com/assets/widgets/donate.svg"></a></noscript>
|
64
numnastics/numnastics.py
Executable file
64
numnastics/numnastics.py
Executable file
@ -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)
|
||||
|
64
numnastics/numnastics.py.bak
Executable file
64
numnastics/numnastics.py.bak
Executable file
@ -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)
|
||||
|
BIN
numnastics/sounds/music_menu.ogg
Normal file
BIN
numnastics/sounds/music_menu.ogg
Normal file
Binary file not shown.
148
numnastics/storm_games.py
Executable file
148
numnastics/storm_games.py
Executable file
@ -0,0 +1,148 @@
|
||||
#!/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
"""Standard initializations and functions shared by all games."""
|
||||
|
||||
import configparser
|
||||
import os
|
||||
from os import listdir
|
||||
from os.path import isfile, join
|
||||
from inspect import isfunction
|
||||
from xdg import BaseDirectory
|
||||
import pygame
|
||||
import random
|
||||
import requests
|
||||
import speechd
|
||||
import time
|
||||
|
||||
localConfig = configparser.ConfigParser()
|
||||
globalConfig = configparser.ConfigParser()
|
||||
spd = speechd.Client()
|
||||
|
||||
def write_config(writeGlobal = False):
|
||||
if writeGlobal == False:
|
||||
with open(gamePath, 'w') as configfile:
|
||||
localConfig.write(configfile)
|
||||
else:
|
||||
with open(globalPath, 'w') as configfile:
|
||||
globalConfig.write(configfile)
|
||||
|
||||
def speak(text, interupt = True):
|
||||
if interupt == True: spd.cancel()
|
||||
spd.say(text)
|
||||
|
||||
def exit_game():
|
||||
spd.close()
|
||||
pygame.quit()
|
||||
exit()
|
||||
|
||||
def initialize_gui(gameTitle):
|
||||
# Check for, and possibly create, storm-games path
|
||||
global globalPath
|
||||
global gamePath
|
||||
globalPath = BaseDirectory.xdg_config_home + "/storm-games"
|
||||
gamePath = globalPath + "/" + str.lower(str.replace(gameTitle, " ", "-") + "config")
|
||||
globalPath = globalPath + "/config"
|
||||
if not os.path.exists(gamePath): os.makedirs(gamePath)
|
||||
# Seed the random generator to the clock
|
||||
random.seed()
|
||||
# Set game's name
|
||||
global gameName
|
||||
gameName = gameTitle
|
||||
# start pygame
|
||||
pygame.init()
|
||||
# start the display (required by the event loop)
|
||||
pygame.display.set_mode((320, 200))
|
||||
pygame.display.set_caption(gameTitle)
|
||||
# Load sounds from the sound directory and creates a list like that {'bottle': 'bottle.ogg'}
|
||||
soundFiles = [f for f in listdir("sounds/") if isfile(join("sounds/", f)) and (f.split('.')[1].lower() in ["ogg","wav"])]
|
||||
#lets make a dict with pygame.mixer.Sound() objects {'bottle':<soundobject>}
|
||||
soundData = {}
|
||||
for f in soundFiles:
|
||||
soundData[f.split('.')[0]] = pygame.mixer.Sound("sounds/" + f)
|
||||
soundData['game-intro'].play()
|
||||
time.sleep(soundData['game-intro'].get_length())
|
||||
return soundData
|
||||
|
||||
def display_message(info):
|
||||
info.append("Press escape or enter to continue.")
|
||||
info.reverse()
|
||||
info.append("Use the up and down arrow keys to navigate this message.")
|
||||
info.reverse()
|
||||
i = 0
|
||||
speak(str(info[0:len(info)]))
|
||||
while True:
|
||||
event = pygame.event.wait()
|
||||
if event.type == pygame.KEYDOWN:
|
||||
if event.key == pygame.K_ESCAPE or event.key == pygame.K_RETURN: return
|
||||
if event.key == pygame.K_DOWN and i < len(info) - 1: i = i + 1
|
||||
if event.key == pygame.K_UP and i > 0: i = i - 1
|
||||
speak(info[i])
|
||||
event = pygame.event.clear()
|
||||
time.sleep(0.001)
|
||||
|
||||
def instructions():
|
||||
info = (
|
||||
"Welcome to " + gameName + ": brought to you by Storm Dragon. Use the up and down arrows to navigate these instructions.",\
|
||||
"The object of the game is to arrange the random string of numbers so they read one through nine in as few tries as possible.",\
|
||||
"You can use the up or left arrow to move back in the string, and the down or right arrow to move forward, or close to the end of the string of numbers.",\
|
||||
"you can also jump directly to the number you want by pressing it on your keyboard. If you want to go to the number 8 in the string, just press 8.",\
|
||||
"When you are on the number you want, press the enter key and that number, plus all the numbers to the end of the string, will be reversed.",\
|
||||
"For example, if you have the string of numbers 1 2 3 4 5 6 9 8 7, pressing enter while on the number 9 will reverse 9 8 7, making the string 1 2 3 4 5 6 7 8 9 and you will win the game.",\
|
||||
"If you need to her the string of numbers from your current position, press the spacebar.",\
|
||||
"Have fun, and good luck!",\
|
||||
"Press escape or enter to return to the game menu.")
|
||||
i = 0
|
||||
speak(info[i])
|
||||
while True:
|
||||
event = pygame.event.wait()
|
||||
if event.type == pygame.KEYDOWN:
|
||||
if event.key == pygame.K_ESCAPE or event.key == pygame.K_RETURN: return
|
||||
if event.key == pygame.K_DOWN and i < len(info) - 1: i = i + 1
|
||||
if event.key == pygame.K_UP and i > 0: i = i - 1
|
||||
speak(info[i])
|
||||
event = pygame.event.clear()
|
||||
time.sleep(0.001)
|
||||
|
||||
def credits():
|
||||
info = (
|
||||
gameName + ": brought to you by Storm Dragon",\
|
||||
"Billy Wolfe, designer and coder.",\
|
||||
"http://stormdragon.tk",\
|
||||
"Press escape or enter to return to the game menu.")
|
||||
i = 0
|
||||
speak(info[i])
|
||||
while True:
|
||||
event = pygame.event.wait()
|
||||
if event.type == pygame.KEYDOWN:
|
||||
if event.key == pygame.K_ESCAPE or event.key == pygame.K_RETURN: return
|
||||
if event.key == pygame.K_DOWN and i < len(info) - 1: i = i + 1
|
||||
if event.key == pygame.K_UP and i > 0: i = i - 1
|
||||
speak(info[i])
|
||||
event = pygame.event.clear()
|
||||
time.sleep(0.001)
|
||||
|
||||
def game_menu(*options):
|
||||
loop = True
|
||||
pygame.mixer.music.load("sounds/music_menu.ogg")
|
||||
pygame.mixer.music.set_volume(0.75)
|
||||
pygame.mixer.music.play(-1)
|
||||
i = 0
|
||||
speak(options[i])
|
||||
while loop == True:
|
||||
event = pygame.event.wait()
|
||||
if event.type == pygame.KEYDOWN:
|
||||
if event.key == pygame.K_ESCAPE: exit_game()
|
||||
if event.key == pygame.K_DOWN and i < len(options) - 1: i = i + 1
|
||||
if event.key == pygame.K_UP and i > 0: i = i - 1
|
||||
if event.key == pygame.K_RETURN:
|
||||
try:
|
||||
eval(options[i] + "()")
|
||||
continue
|
||||
except:
|
||||
pygame.mixer.music.fadeout(500)
|
||||
time.sleep(0.25)
|
||||
return options[i]
|
||||
continue
|
||||
speak(options[i])
|
||||
event = pygame.event.clear()
|
||||
time.sleep(0.001)
|
23
pybottle/bottle-blaster.py
Executable file
23
pybottle/bottle-blaster.py
Executable file
@ -0,0 +1,23 @@
|
||||
#!/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
# Shoot the bottles as fast as possible.
|
||||
|
||||
from storm_games import *
|
||||
|
||||
sounds = initialize_gui("Bottle Blaster")
|
||||
|
||||
# loop forever (until a break occurs)
|
||||
while True:
|
||||
# wait for an event
|
||||
event = pygame.event.wait()
|
||||
# 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...
|
||||
if event.key == pygame.K_ESCAPE:
|
||||
# ... then exit from the while loop
|
||||
break
|
||||
time.sleep(.001)
|
BIN
pybottle/sounds/bottle.ogg
Normal file
BIN
pybottle/sounds/bottle.ogg
Normal file
Binary file not shown.
BIN
pybottle/sounds/empty.ogg
Normal file
BIN
pybottle/sounds/empty.ogg
Normal file
Binary file not shown.
BIN
pybottle/sounds/game-intro.ogg
Normal file
BIN
pybottle/sounds/game-intro.ogg
Normal file
Binary file not shown.
BIN
pybottle/sounds/glass1.ogg
Normal file
BIN
pybottle/sounds/glass1.ogg
Normal file
Binary file not shown.
BIN
pybottle/sounds/glass2.ogg
Normal file
BIN
pybottle/sounds/glass2.ogg
Normal file
Binary file not shown.
BIN
pybottle/sounds/glass3.ogg
Normal file
BIN
pybottle/sounds/glass3.ogg
Normal file
Binary file not shown.
BIN
pybottle/sounds/gun1.ogg
Normal file
BIN
pybottle/sounds/gun1.ogg
Normal file
Binary file not shown.
BIN
pybottle/sounds/gun2.ogg
Normal file
BIN
pybottle/sounds/gun2.ogg
Normal file
Binary file not shown.
BIN
pybottle/sounds/gun3.ogg
Normal file
BIN
pybottle/sounds/gun3.ogg
Normal file
Binary file not shown.
BIN
pybottle/sounds/gun4.ogg
Normal file
BIN
pybottle/sounds/gun4.ogg
Normal file
Binary file not shown.
BIN
pybottle/sounds/gun5.ogg
Normal file
BIN
pybottle/sounds/gun5.ogg
Normal file
Binary file not shown.
BIN
pybottle/sounds/load3.ogg
Normal file
BIN
pybottle/sounds/load3.ogg
Normal file
Binary file not shown.
BIN
pybottle/sounds/load4.ogg
Normal file
BIN
pybottle/sounds/load4.ogg
Normal file
Binary file not shown.
BIN
pybottle/sounds/load5.ogg
Normal file
BIN
pybottle/sounds/load5.ogg
Normal file
Binary file not shown.
29
pybottle/storm_games.py
Executable file
29
pybottle/storm_games.py
Executable file
@ -0,0 +1,29 @@
|
||||
#!/bin/python
|
||||
# -*- 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
|
||||
|
||||
def speak(text, interupt = True):
|
||||
if interupt == True: espeak.cancel()
|
||||
espeak.set_voice("en-us")
|
||||
espeak.synth(text)
|
||||
|
||||
def initialize_gui(gameTitle):
|
||||
# start pygame
|
||||
pygame.init()
|
||||
# start the display (required by the event loop)
|
||||
pygame.display.set_mode((320, 200))
|
||||
pygame.display.set_caption(gameTitle)
|
||||
# Load sounds from the sound directory and creates a list like that {'bottle': 'bottle.ogg'}
|
||||
soundFiles = [f for f in listdir("sounds/") if isfile(join("sounds/", f)) and (f.split('.')[1].lower() in ["ogg","wav"])]
|
||||
#lets make a dict with pygame.mixer.Sound() objects {'bottle':<soundobject>}
|
||||
soundData = {}
|
||||
for f in soundFiles:
|
||||
soundData[f.split('.')[0]] = pygame.mixer.Sound("sounds/" + f)
|
||||
return soundData
|
33
sex/sex
Executable file
33
sex/sex
Executable file
@ -0,0 +1,33 @@
|
||||
#!/bin/bash
|
||||
|
||||
#simplest way to convert the sex program to bash
|
||||
#The C version is available from: http://spatula.net/software/sex/
|
||||
#This version is released under the terms of the WTFPL http://www.wtfpl.net/
|
||||
|
||||
#set up random parts of the sentence
|
||||
faster="$(shuf -n 1 -e "\"Let the games begin!\"" "\"Sweet Jesus!\"" "\"Not that!\"" "\"At last!\"" "\"Land o' Goshen!\"" "\"Is that all?\"" "\"Cheese it, the cops!\"" "\"I never dreamed it could be\"" "\"If I do, you won't respect me!\"" "\"Now!\"" "\"Open sesame!\"" "\"EMR!\"" "\"Again!\"" "\"Faster!\"" "\"Harder!\"" "\"Help!\"" "\"Fuck me harder!\"" "\"Is it in yet?\"" "\"You aren't my father!\"" "\"Doctor, that's not *my* shou\"" "\"No, no, do the goldfish!\"" "\"Holy Batmobile, Batman!\"" "\"He's dead, he's dead!\"" "\"Take me, Robert!\"" "\"I'm a Republican!\"" "\"Put four fingers in!\"" "\"What a lover!\"" "\"Talk dirty, you pig!\"" "\"The ceiling needs painting,\"" "\"Suck harder!\"" "\"The animals will hear!\"" "\"Not in public!\"")"
|
||||
said="$( shuf -n 1 -e "bellowed" "yelped" "croaked" "growled" "panted" "moaned" "grunted" "laughed" "warbled" "sighed" "ejaculated" "choked" "stammered" "wheezed" "squealed" "whimpered" "salivated" "tongued" "cried" "screamed" "yelled" "said")"
|
||||
fadj="$(shuf -n 1 -e "saucy" "wanton" "unfortunate" "lust-crazed" "nine-year-old" "bull-dyke" "bisexual" "gorgeous" "sweet" "nymphomaniacal" "large-hipped" "freckled" "forty-five year old" "white-haired" "large-boned" "saintly" "blind" "bearded" "blue-eyed" "large tongued" "friendly" "piano playing" "ear licking" "doe eyed" "sock sniffing" "lesbian" "hairy")"
|
||||
female="$(shuf -n 1 -e "baggage" "hussy" "woman" "Duchess" "female impersonator" "nymphomaniac" "virgin" "leather freak" "home-coming queen" "defrocked nun" "bisexual budgie" "cheerleader" "office secretary" "sexual deviate" "DARPA contract monitor" "little matchgirl" "ceremonial penguin" "femme fatale" "bosses' daughter" "construction worker" "sausage abuser" "secretary" "Congressman's page" "grandmother" "penguin" "German shepherd" "stewardess" "waitress" "prostitute" "computer science group" "housewife")"
|
||||
madjec="$(shuf -n 1 -e "thrashing" "slurping" "insatiable" "rabid" "satanic" "corpulent" "nose-grooming" "tripe-fondling" "dribbling" "spread-eagled" "orally fixated" "vile" "awesomely endowed" "handsome" "mush-brained" "tremendously hung" "three-legged" "pile-driving" "cross-dressing" "gerbil buggering" "bung-hole stuffing" "sphincter licking" "hair-pie chewing" "muff-diving" "clam shucking" "egg-sucking" "bicycle seat sniffing")"
|
||||
male="$(shuf -n 1 -e "rakehell" "hunchback" "lecherous lickspittle" "archduke" "midget" "hired hand" "great Dane" "stallion" "donkey" "electric eel" "paraplegic pothead" "dirty old man" "faggot butler" "friar" "black-power advocate" "follicle fetishist" "handsome priest" "chicken flicker" "homosexual flamingo" "ex-celibate" "drug sucker" "ex-woman" "construction worker" "hair dresser" "dentist" "judge" "social worker")"
|
||||
diddled="$(shuf -n 1 -e "diddled" "devoured" "fondled" "mouthed" "tongued" "lashed" "tweaked" "violated" "defiled" "irrigated" "penetrated" "ravished" "hammered" "bit" "tongue slashed" "sucked" "fucked" "rubbed" "grudge fucked" "masturbated with" "slurped")"
|
||||
titadj="$(shuf -n 1 -e "alabaster" "pink-tipped" "creamy" "rosebud" "moist" "throbbing" "juicy" "heaving" "straining" "mammoth" "succulent" "quivering" "rosey" "globular" "varicose" "jiggling" "bloody" "tilted" "dribbling" "oozing" "firm" "pendulous" "muscular" "bovine")"
|
||||
knockers="$(shuf -n 1 -e "globes" "melons" "mounds" "buds" "paps" "chubbies" "protuberances" "treasures" "buns" "bung" "vestibule" "armpits" "tits" "knockers" "elbows" "eyes" "hooters" "jugs" "lungs" "headlights" "disk drives" "bumpers" "knees" "fried eggs" "buttocks" "charlies" "ear lobes" "bazooms" "mammaries")"
|
||||
thrust="$(shuf -n 1 -e "plunged" "thrust" "squeezed" "pounded" "drove" "eased" "slid" "hammered" "squished" "crammed" "slammed" "reamed" "rammed" "dipped" "inserted" "plugged" "augured" "pushed" "ripped" "forced" "wrenched")"
|
||||
dongadj="$(shuf -n 1 -e "bursting" "jutting" "glistening" "Brobdingnagian" "prodigious" "purple" "searing" "swollen" "rigid" "rampaging" "warty" "steaming" "gorged" "trunklike" "foaming" "spouting" "swinish" "prosthetic" "blue veined" "engorged" "horse like" "throbbing" "humongous" "hole splitting" "serpentine" "curved" "steel encased" "glass encrusted" "knobby" "surgically altered" "metal tipped" "open sored" "rapidly dwindling" "swelling" "miniscule" "boney")"
|
||||
dong="$(shuf -n 1 -e "intruder" "prong" "stump" "member" "meat loaf" "majesty" "bowsprit" "earthmover" "jackhammer" "ramrod" "cod" "jabber" "gusher" "poker" "engine" "brownie" "joy stick" "plunger" "piston" "tool" "manhood" "lollipop" "kidney prodder" "candlestick" "John Thomas" "arm" "testicles" "balls" "finger" "foot" "tongue" "dick" "one-eyed wonder worm" "canyon yodeler" "middle leg" "neck wrapper" "stick shift" "dong" "Linda Lovelace choker")"
|
||||
twatadj="$(shuf -n 1 -e "pulsing" "hungry" "hymeneal" "palpitating" "gaping" "slavering" "welcoming" "glutted" "gobbling" "cobwebby" "ravenous" "slurping" "glistening" "dripping" "scabiferous" "porous" "soft-spoken" "pink" "dusty" "tight" "odiferous" "moist" "loose" "scarred" "weapon-less" "banana stuffed" "tire tracked" "mouse nibbled" "tightly tensed" "oft traveled" "grateful" "festering")"
|
||||
twat="$(shuf -n 1 -e "swamp." "honeypot." "jam jar." "butterbox." "furburger." "cherry pie." "cush." "slot." "slit." "cockpit." "damp." "furrow." "sanctum sanctorum." "bearded clam." "continental divide." "paradise valley." "red river valley." "slot machine." "quim." "palace." "ass." "rose bud." "throat." "eye socket." "tenderness." "inner ear." "orifice." "appendix scar." "wound." "navel." "mouth." "nose." "cunt.")"
|
||||
|
||||
#set default wordwrap to 80
|
||||
if [[ "$1" == "-w" && "$2" =~ ^[0-9]+$ && $2 -gt 0 && $2 -le 500 ]] ; then
|
||||
lineLength=$2
|
||||
fi
|
||||
#generate the sentence with wordwrap
|
||||
if [ -n "$lineLength" ] ; then
|
||||
echo "$faster $said the $fadj $female as the $madjec $male $diddled her $titadj $knockers and $thrust his $dongadj $dong into her $twatadj $twat" | fold -sw $lineLength
|
||||
else
|
||||
echo "$faster $said the $fadj $female as the $madjec $male $diddled her $titadj $knockers and $thrust his $dongadj $dong into her $twatadj $twat"
|
||||
fi
|
||||
exit 0
|
@ -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
|
||||
|
BIN
zombie-dice/sounds/Running sound effect.webm
Normal file
BIN
zombie-dice/sounds/Running sound effect.webm
Normal file
Binary file not shown.
BIN
zombie-dice/sounds/brain.ogg
Normal file
BIN
zombie-dice/sounds/brain.ogg
Normal file
Binary file not shown.
BIN
zombie-dice/sounds/die.ogg
Normal file
BIN
zombie-dice/sounds/die.ogg
Normal file
Binary file not shown.
BIN
zombie-dice/sounds/intro.ogg
Normal file
BIN
zombie-dice/sounds/intro.ogg
Normal file
Binary file not shown.
BIN
zombie-dice/sounds/lose_turn.ogg
Normal file
BIN
zombie-dice/sounds/lose_turn.ogg
Normal file
Binary file not shown.
BIN
zombie-dice/sounds/runner.ogg
Normal file
BIN
zombie-dice/sounds/runner.ogg
Normal file
Binary file not shown.
BIN
zombie-dice/sounds/shotgun.ogg
Normal file
BIN
zombie-dice/sounds/shotgun.ogg
Normal file
Binary file not shown.
72
zombie-dice/zombie-dice
Executable file
72
zombie-dice/zombie-dice
Executable file
@ -0,0 +1,72 @@
|
||||
#!/bin/bash
|
||||
|
||||
check_dependancies()
|
||||
{
|
||||
if [ $# -eq 0 ] ; then
|
||||
if [[ $(bash --version | head -n 1 | cut -f 1 -d "." | tr -d "[:alpha:]") < "4" ]] ; then
|
||||
echo "This game requires bash version 4 or higher. Earlier versions may not be able to successfully run this code."
|
||||
fi
|
||||
if ! hash sox &> /dev/null ; then
|
||||
echo "The program sox is required but does not appear to be installed on your system. Please install sox and try
|
||||
again."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
for i in $@ ; do
|
||||
if ! hash $i &> /dev/null ; then
|
||||
echo "The program $i is required but does not appear to be installed on your system. Please install $i and try
|
||||
again."
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
initialize_players()
|
||||
{
|
||||
i=1
|
||||
while [ $i -le $1 ] ; do
|
||||
player[$i]=0
|
||||
let i++
|
||||
done
|
||||
}
|
||||
|
||||
play_sound()
|
||||
{
|
||||
play -qV0 sounds/$@
|
||||
}
|
||||
|
||||
check_dependancies
|
||||
check_dependancies rolldice
|
||||
#get terminal width
|
||||
columns=$(tput cols)
|
||||
play_sound intro.ogg
|
||||
#find out how many players there are
|
||||
if [ $# -gt 1 ] ; then
|
||||
echo "Usage: $0 or $0 number of players."
|
||||
exit 1
|
||||
fi
|
||||
if [ $# -eq 1 ] ; then
|
||||
if ! [[ "$1" =~ ^[0-9]+$ ]] ; then
|
||||
echo "The number of players must be a number, 2 or greater."
|
||||
exit 1
|
||||
fi
|
||||
if [ $1 -lt 2 ] ; then
|
||||
echo "The number of players must be a number, 2 or greater."
|
||||
exit 1
|
||||
fi
|
||||
totalPlayers=$1
|
||||
else
|
||||
totalPlayers=2
|
||||
cpu=true
|
||||
fi
|
||||
initialize_players $totalPlayers
|
||||
#determine who goes first.
|
||||
playerIndex=$(rolldice 1d${#player[@]})
|
||||
while [ $playerIndex -gt 0 ] ; do
|
||||
score_keeper $playerIndex
|
||||
let playerIndex++
|
||||
if [ $playerIndex -gt ${#player[@]} ] ; then
|
||||
playerIndex=1
|
||||
fi
|
||||
done
|
||||
exit 0
|
Loading…
Reference in New Issue
Block a user