-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
46 changed files
with
4,871 additions
and
522 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
#!/bin/bash | ||
|
||
# Build all game cartridges and install them in PICO-8 carts folder. | ||
|
||
# Currently only supported on Linux. | ||
|
||
# Configuration: paths | ||
game_scripts_path="$(dirname "$0")" | ||
|
||
help() { | ||
echo "Build and install all PICO-8 cartridges with the passed config." | ||
usage | ||
} | ||
|
||
usage() { | ||
echo "Usage: build_and_install_all_cartridges.sh [CONFIG] | ||
ARGUMENTS | ||
CONFIG Build config. Determines defined preprocess symbols. | ||
(default: 'debug') | ||
-h, --help Show this help message | ||
" | ||
} | ||
|
||
# Default parameters | ||
config='debug' | ||
|
||
# Read arguments | ||
# https://stackoverflow.com/questions/192249/how-do-i-parse-command-line-arguments-in-bash | ||
roots=() | ||
while [[ $# -gt 0 ]]; do | ||
case $1 in | ||
-h | --help ) | ||
help | ||
exit 0 | ||
;; | ||
-* ) # unknown option | ||
echo "Unknown option: '$1'" | ||
usage | ||
exit 1 | ||
;; | ||
* ) # store positional argument for later | ||
positional_args+=("$1") | ||
shift # past argument | ||
;; | ||
esac | ||
done | ||
|
||
if ! [[ ${#positional_args[@]} -ge 0 && ${#positional_args[@]} -le 1 ]]; then | ||
echo "Wrong number of positional arguments: found ${#positional_args[@]}, expected 0 or 1." | ||
echo "Passed positional arguments: ${positional_args[@]}" | ||
usage | ||
exit 1 | ||
fi | ||
|
||
if [[ ${#positional_args[@]} -ge 1 ]]; then | ||
config="${positional_args[0]}" | ||
fi | ||
|
||
"$game_scripts_path/build_all_cartridges.sh" "$config" | ||
"$game_scripts_path/install_all_cartridges.sh" "$config" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
#!/bin/bash | ||
|
||
# Build a specific cartridge for the game and install it in PICO-8 carts folder | ||
# to allow playing with multiple cartridges | ||
|
||
# Currently only supported on Linux | ||
|
||
# Configuration: paths | ||
game_scripts_path="$(dirname "$0")" | ||
|
||
help() { | ||
echo "Build a PICO-8 cartridge with the passed config." | ||
usage | ||
} | ||
|
||
usage() { | ||
echo "Usage: build_and_install_single_cartridge.sh CARTRIDGE_SUFFIX [CONFIG] | ||
ARGUMENTS | ||
CARTRIDGE_SUFFIX Cartridge to build for the multi-cartridge game | ||
'titlemenu' or 'ingame' | ||
CONFIG Build config. Determines defined preprocess symbols. | ||
(default: 'debug') | ||
-h, --help Show this help message | ||
" | ||
} | ||
|
||
# Default parameters | ||
config='debug' | ||
|
||
# Read arguments | ||
# https://stackoverflow.com/questions/192249/how-do-i-parse-command-line-arguments-in-bash | ||
roots=() | ||
while [[ $# -gt 0 ]]; do | ||
case $1 in | ||
-h | --help ) | ||
help | ||
exit 0 | ||
;; | ||
-* ) # unknown option | ||
echo "Unknown option: '$1'" | ||
usage | ||
exit 1 | ||
;; | ||
* ) # store positional argument for later | ||
positional_args+=("$1") | ||
shift # past argument | ||
;; | ||
esac | ||
done | ||
|
||
if ! [[ ${#positional_args[@]} -ge 1 && ${#positional_args[@]} -le 2 ]]; then | ||
echo "Wrong number of positional arguments: found ${#positional_args[@]}, expected 1 or 2." | ||
echo "Passed positional arguments: ${positional_args[@]}" | ||
usage | ||
exit 1 | ||
fi | ||
|
||
if [[ ${#positional_args[@]} -ge 1 ]]; then | ||
cartridge_suffix="${positional_args[0]}" | ||
fi | ||
|
||
if [[ ${#positional_args[@]} -ge 2 ]]; then | ||
config="${positional_args[1]}" | ||
fi | ||
|
||
# Immediately export to carts to allow multi-cartridge loading | ||
"$game_scripts_path/build_single_cartridge.sh" "$cartridge_suffix" "$config" | ||
|
||
if [[ $? -ne 0 ]]; then | ||
echo "" | ||
echo "build_single_cartridge.sh failed, STOP." | ||
exit 1 | ||
fi | ||
|
||
"$game_scripts_path/install_single_cartridge.sh" "$cartridge_suffix" "$config" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.