Skip to content

v1.1.0

Choose a tag to compare

@stuffbymax stuffbymax released this 10 Apr 22:42
· 35 commits to main since this release
eba11a1

i did fix a some bugs in the code

This Bash script is a simple Pac-Man-like game with added features such as an animation at the start, multiple levels, and victory conditions. Let's break down its components and functionality:

Animation Function (display_animation):

This function displays a short animation of the player character (C) and the ghost character (G) moving towards each other. The animation iterates through a few frames with a short delay between each frame.
Game Initialization and Setup:

After the animation, the script enters the main menu loop, where users can choose to start the game, display help instructions, or exit the program.
Each option in the main menu corresponds to a different function (start_game, display_help, exit_game).
Start Game Function (start_game):

Initializes variables such as player, ghost, empty space, walls, food, and score.
Defines the game board as a multi-line string stored in an array.
Contains functions for printing the game board, checking valid positions, moving the player and ghosts, spawning ghosts and food, handling game over scenarios (with timer or victory condition), and resetting the game.
Enters a main game loop where the game state is updated based on user input and the positions of player and ghosts are adjusted accordingly.
Checks for game over conditions (player death or victory) and prompts the user to restart or return to the main menu.
Display Help Function (display_help):

Displays information about game controls, objectives, and in-game shortcuts.
Prompts the user to press Enter to continue.
Main Menu Function (main_menu):

Displays the main menu options.
Reads user input for selecting an option.
Calls corresponding functions based on user choice.
Other Functions:

exit_game: Exits the script with a goodbye message.
game_over_with_victory: Displays a victory message when the player collects all the food items on the board.
spawn_food: Randomly spawns food items on the game board.
Overall, this script provides a simple but interactive Pac-Man-like gaming experience within the Bash shell, complete with animations, multiple levels, and victory conditions.

Full Changelog: bash-pacv1.0.0...bash-pacv1.1.0