Skip to content

Commit

Permalink
added air sfx
Browse files Browse the repository at this point in the history
  • Loading branch information
stuffbymax committed Feb 14, 2025
1 parent 4a9dc59 commit dfea4b2
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 1 deletion.
2 changes: 1 addition & 1 deletion bta-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ travel_to() {

if (( cash >= travel_cost )); then
echo "Traveling to $new_location..."
play_sfx "car_travel" # Play a traveling sound
play_sfx_mpg "air"
cash=$((cash - travel_cost))
read -r -p "Press Enter to continue..."
location="$new_location"
Expand Down
67 changes: 67 additions & 0 deletions for-devs/animation/anitest.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
#!/bin/bash

# --- Animation Frames ---
frames=(
"
_,-._
/ \_/ \
>-(_)-<
\_/ \_/
`-'
"
"
_,-._
/ \_/ \
>-(_)-<
\_/ \_/
`-'
"
"
_,-._
/ \_/ \
>-(_)-<
\_/ \_/
`-'
"
"
_,-._
/ \_/ \
>-(_)-<
\_/ \_/
`-'
"
)
# --- Animation Speed ---
delay=0.1 # Seconds between frames
# --- Function to Display Animation ---
animate() {
local frame_count=${#frames[@]}
local i=0
while true; do
clear
echo "${frames[$i]}"
sleep "$delay"
((i = (i + 1) % frame_count)) # Cycle through frames
done
}
# --- Main Script ---
# Check for Ctrl+C (SIGINT) and exit cleanly
trap "clear; exit 0" SIGINT
animate & # Run animation in the background
pid=$! # Get process ID of the animation
# Simulate other parts of your script here:
sleep 5 # Animation runs for 5 seconds
# --- Stop Animation and Exit ---
kill "$pid" # Stop the animation process
wait "$pid" # Wait for the animation process to finish
clear
echo "Animation stopped."
exit 0
Binary file added sfx/air.mp3
Binary file not shown.

0 comments on commit dfea4b2

Please sign in to comment.