diff --git a/bashit/bashit b/bashit/bashit new file mode 100755 index 0000000..fb7b368 --- /dev/null +++ b/bashit/bashit @@ -0,0 +1,134 @@ +#!/bin/bash + +play_stop_bgm() +{ +if [ "$1" == "play" ] ; then +play -qV0 $2/bgm.ogg repeat 9999& +__bgmPID="$(echo "$!")" +elif [ "$1" == "stop" ] ; then +if [[ "$__bgmPID" =~ ^[0-9]+$ ]] ; then +kill $__bgmPID +unset __bgmPID +fi +fi +} + +select_soundpack() +{ +local __soundPackVariable=$1 +local i=1 +for x in sounds/* ; do +if [ -d "$x" ] ; then +local soundPackList[$i]="$x" +if [ $i -lt 10 ] ; then +echo -n "0" +fi +echo "$i: $(basename "$x")" +let i++ +fi +done +local continue="false" +while [ "$continue" == "false" ] ; do +local continue="true" +read -p "Select a soundpack: " soundpack +if ! [[ "$soundpack" =~ ^[0-9]+$ ]] ; then +local continue="false" +else +if ! [[ "$soundpack" =~ [1-9]+$ ]] ; then +local continue="false" +fi +if [ $soundpack -lt 1 -o $soundpack -gt $(($i - 1)) ] ; then +local continue="false" +fi +fi +done +if [[ $__soundPackVariable ]] ; then +eval $__soundPackVariable="'${soundPackList[$soundpack]}'" +else +echo "${soundPackList[$soundPack]}" +fi +} + +play_bopit_direction() +{ +local soundpack=$1 +local __directionVariable=$2 +direction="$(shuf -n 1 -e "center" "left" "right")" +case "$direction" in +"center") +play -qV0 $(shuf -n 1 -e $soundpack/cpu*ogg) remix v0.9 v0.9& +;; +"left") +play -qV0 $(shuf -n 1 -e $soundpack/cpu*ogg) remix v0.9 v0.1& +;; +"right") +play -qV0 $(shuf -n 1 -e $soundpack/cpu*ogg) remix v0.1 v0.9& +;; +esac +if [[ $__directionVariable ]] ; then +eval $__directionVariable="'$direction'" +else +echo "$direction" +fi +} + +#Main Game Loop +select_soundpack sound +speed="1.50" +continue="true" +if [ -f "$sound/intro.ogg" ] ; then +play -qV0 $sound/intro.ogg +else +echo "Ready" +echo +sleep 1 +echo "set" +echo +sleep 1 +echo "go" +fi +play_stop_bgm play $sound +difficultyIndex=0 +score=0 +while [ "$continue" == "true" ] ; do +if [ $difficultyIndex -ge 2 ] ; then +difficultyIndex=0 +if [ "$speed" != "0.01" ] ; then +speed="$(echo "scale=2;$speed - .01" | bc)" +fi +fi +play_bopit_direction $sound bopDirection +read -st $speed -n 1 key +case "${key^}" in +"J") +key="left" +;; +"K") +key="center" +;; +"L") +key="right" +;; +esac +if [ "$key" != "$bopDirection" ] ; then +continue="false" +else +let score++ +case "$key" in +"center") +play -qV0 $(shuf -n 1 -e $sound/player*ogg) remix v0.9 v0.9 +;; +"left") +play -qV0 $(shuf -n 1 -e $sound/player*ogg) remix v0.9 v0.1 +;; +"right") +play -qV0 $(shuf -n 1 -e $sound/player*ogg) remix v0.1 v0.9 +;; +esac +fi +let difficultyIndex++ +done +play_stop_bgm stop +echo +echo "Score: $score." +exit 0 diff --git a/bashit/sounds/bees/bgm.ogg b/bashit/sounds/bees/bgm.ogg new file mode 100644 index 0000000..5a89970 Binary files /dev/null and b/bashit/sounds/bees/bgm.ogg differ diff --git a/bashit/sounds/bees/cpu.ogg b/bashit/sounds/bees/cpu.ogg new file mode 100644 index 0000000..ceff947 Binary files /dev/null and b/bashit/sounds/bees/cpu.ogg differ diff --git a/bashit/sounds/bees/player.ogg b/bashit/sounds/bees/player.ogg new file mode 100644 index 0000000..ba78862 Binary files /dev/null and b/bashit/sounds/bees/player.ogg differ diff --git a/bashit/sounds/bees/tmp.ogg b/bashit/sounds/bees/tmp.ogg new file mode 100644 index 0000000..86784b1 Binary files /dev/null and b/bashit/sounds/bees/tmp.ogg differ diff --git a/bashit/sounds/women/bgm.ogg b/bashit/sounds/women/bgm.ogg new file mode 100644 index 0000000..19ed1a8 Binary files /dev/null and b/bashit/sounds/women/bgm.ogg differ diff --git a/bashit/sounds/women/cpu.ogg b/bashit/sounds/women/cpu.ogg new file mode 100644 index 0000000..8ca4734 Binary files /dev/null and b/bashit/sounds/women/cpu.ogg differ diff --git a/bashit/sounds/women/cpu1.ogg b/bashit/sounds/women/cpu1.ogg new file mode 100644 index 0000000..29ec64a Binary files /dev/null and b/bashit/sounds/women/cpu1.ogg differ diff --git a/bashit/sounds/women/cpu2.ogg b/bashit/sounds/women/cpu2.ogg new file mode 100644 index 0000000..bfce88f Binary files /dev/null and b/bashit/sounds/women/cpu2.ogg differ diff --git a/bashit/sounds/women/cpu3.ogg b/bashit/sounds/women/cpu3.ogg new file mode 100644 index 0000000..106f837 Binary files /dev/null and b/bashit/sounds/women/cpu3.ogg differ diff --git a/bashit/sounds/women/cpu4.ogg b/bashit/sounds/women/cpu4.ogg new file mode 100644 index 0000000..677c117 Binary files /dev/null and b/bashit/sounds/women/cpu4.ogg differ diff --git a/bashit/sounds/women/intro.ogg b/bashit/sounds/women/intro.ogg new file mode 100644 index 0000000..e4ececc Binary files /dev/null and b/bashit/sounds/women/intro.ogg differ diff --git a/bashit/sounds/women/lose.ogg b/bashit/sounds/women/lose.ogg new file mode 100644 index 0000000..d995197 Binary files /dev/null and b/bashit/sounds/women/lose.ogg differ diff --git a/bashit/sounds/women/player.ogg b/bashit/sounds/women/player.ogg new file mode 100644 index 0000000..ded4cb4 Binary files /dev/null and b/bashit/sounds/women/player.ogg differ diff --git a/bashit/sounds/women/player1.ogg b/bashit/sounds/women/player1.ogg new file mode 100644 index 0000000..1ac47db Binary files /dev/null and b/bashit/sounds/women/player1.ogg differ diff --git a/bashit/sounds/women/player10.ogg b/bashit/sounds/women/player10.ogg new file mode 100644 index 0000000..99edabb Binary files /dev/null and b/bashit/sounds/women/player10.ogg differ diff --git a/bashit/sounds/women/player2.ogg b/bashit/sounds/women/player2.ogg new file mode 100644 index 0000000..e8e45a7 Binary files /dev/null and b/bashit/sounds/women/player2.ogg differ diff --git a/bashit/sounds/women/player3.ogg b/bashit/sounds/women/player3.ogg new file mode 100644 index 0000000..40778ea Binary files /dev/null and b/bashit/sounds/women/player3.ogg differ diff --git a/bashit/sounds/women/player4.ogg b/bashit/sounds/women/player4.ogg new file mode 100644 index 0000000..0ec731b Binary files /dev/null and b/bashit/sounds/women/player4.ogg differ diff --git a/bashit/sounds/women/player5.ogg b/bashit/sounds/women/player5.ogg new file mode 100644 index 0000000..bb7aa06 Binary files /dev/null and b/bashit/sounds/women/player5.ogg differ diff --git a/bashit/sounds/women/player6.ogg b/bashit/sounds/women/player6.ogg new file mode 100644 index 0000000..829645e Binary files /dev/null and b/bashit/sounds/women/player6.ogg differ diff --git a/bashit/sounds/women/player7.ogg b/bashit/sounds/women/player7.ogg new file mode 100644 index 0000000..f01a49e Binary files /dev/null and b/bashit/sounds/women/player7.ogg differ diff --git a/bashit/sounds/women/player8.ogg b/bashit/sounds/women/player8.ogg new file mode 100644 index 0000000..35d61ee Binary files /dev/null and b/bashit/sounds/women/player8.ogg differ diff --git a/bashit/sounds/women/player9.ogg b/bashit/sounds/women/player9.ogg new file mode 100644 index 0000000..10deae8 Binary files /dev/null and b/bashit/sounds/women/player9.ogg differ diff --git a/bashit/sounds/women/spank.ogg b/bashit/sounds/women/spank.ogg new file mode 100644 index 0000000..4fb3892 Binary files /dev/null and b/bashit/sounds/women/spank.ogg differ