Skip to content

Commit

Permalink
Finish v5.4
Browse files Browse the repository at this point in the history
  • Loading branch information
hsandt committed Apr 17, 2021
2 parents 0d286af + 2980e06 commit 5a40436
Show file tree
Hide file tree
Showing 38 changed files with 1,519 additions and 219 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ before_script:
- ln -s "$(pwd)/tool/picotool-master/p8tool" "$HOME/.local/bin/p8tool"

script:
# build game and itest to make sure everything works fine
# build game to make sure everything works fine
# (even if build fails, tests will be run independently thanks to busted)
# disabled build_game.sh debug because character count may get over 65536
# easily when working at the limit, and fail; while build release is what really counts
Expand Down
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [5.4] - 2021-04-17
### Added
- Audio: added "got all emeralds" jingle with delay
- Audio: added menu swipe (zigzag fade-out) SFX during stage clear
- Character physics: character can land on ceiling corners up to 45 degrees
- Character physics: fixed character jittering when walking down from the top of the first curved slope to the left. Now, character falls when ground angle changes by 45 degrees or more. This is an original feature and differs from Sonic 3, which would let Sonic stick to the curved slope while running as if it was flat ground.

### Changed
- Stage intro: fixed fade-in color palette swap not applied on first frame
- Stage clear: do not show "Retry (keep emeralds)" if you got 0 emeralds
- Export (web): improved HTML template to just fit the game canvas
- Export: stripped some unused code/data for smaller cartridge
- Engine: updated pico-boots and adapted API calls

## [5.3] - 2021-02-01
### Added
- Stage: added horizontal springs (internally now fully-fledged objects instead of tiles)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ However, if you download the cartridges or compressed cartridges (png) archive t

1. This game uses multiple cartridges, therefore you need to unzip the archive in your local PICO-8 *carts* folder so it can properly detect and load neighbor cartridges on game state transition (if you only want to play the core game and without title menu, you can just run picosonic_ingame.p8 anywhere, but note that it will freeze when the stage has been finished)

2. The ingame cartridge (in .p8 or .p8.png form) cannot be run with a vanilla PICO-8 as it exceeds the maximum token limit (8192). To play it, you need to patch your PICO-8 executable to support more tokens, by either following the procedure I described in [this thread](https://www.lexaloffle.com/bbs/?pid=71689#p) or applying the patches provided in [pico-boots/scripts/patches](pico-boots/scripts/patches) (currently only provided for Linux, OSX and Windows runtime binaries; I will try to push patches for the editor, which you are probably using if you own PICO-8). You will need xdelta3 to apply the patches.
2. The ingame cartridge (in .p8 or .p8.png form) cannot be run with a vanilla PICO-8 as it exceeds the maximum token limit (8192). To play it, you need to patch your PICO-8 executable to support more tokens, by either following the procedure I described in [this thread](https://www.lexaloffle.com/bbs/?pid=71689#p) or applying the patches provided in [pico-boots/scripts/patches](https://github.com/hsandt/pico-boots/tree/develop/scripts/patches) (currently only provided for Linux, OSX and Windows runtime binaries; I will try to push patches for the editor, which you are probably using if you own PICO-8). You will need xdelta3 to apply the patches.

3. I also recommend using a fast reload patch to instantly stream stage data. Otherwise, the game will pause half a second every time the character is approaching a different 128x32-tiles region of the map, and also in the transition area between two regions. Similarly to 2., you should apply the patch from the patches folder using xdelta3 (editor patches not available yet).

Expand Down
7 changes: 6 additions & 1 deletion build_itest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
picoboots_scripts_path="$(dirname "$0")/pico-boots/scripts"
game_src_path="$(dirname "$0")/src"
data_path="$(dirname "$0")/data"
build_output_path="$(dirname "$0")/build"
build_dir_path="$(dirname "$0")/build"

# Configuration: cartridge
version=`cat "$data_path/version.txt"`
Expand All @@ -29,6 +29,11 @@ symbols='itest,proto,tostring'

cartridge_suffix="$1"; shift

# Define build output folder from config
# (to simplify cartridge loading, cartridge files are always named the same,
# so we can only distinguish builds by their folder names)
build_output_path="${build_dir_path}/v${version}_${config}"

# Build from itest main for all itests
# metadata doesn't really matter for tests, we pass it anyway
"$picoboots_scripts_path/build_cartridge.sh" \
Expand Down
6 changes: 3 additions & 3 deletions build_single_cartridge.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

# Configuration: paths
picoboots_scripts_path="$(dirname "$0")/pico-boots/scripts"
game_scripts_path="$(dirname "$0")"
game_src_path="$(dirname "$0")/src"
data_path="$(dirname "$0")/data"
build_dir_path="$(dirname "$0")/build"

# Configuration: cartridge
version=`cat "$data_path/version.txt"`
Expand Down Expand Up @@ -78,7 +78,7 @@ fi
# Define build output folder from config
# (to simplify cartridge loading, cartridge files are always named the same,
# so we can only distinguish builds by their folder names)
build_output_path="$(dirname "$0")/build/v${version}_${config}"
build_output_path="${build_dir_path}/v${version}_${config}"

# Define symbols from config
symbols=''
Expand Down Expand Up @@ -119,7 +119,7 @@ symbols+="$cartridge_suffix"
# so we can use PICO-8 load() with a cartridge file name
# independent from the version and config

# Build cartridge (titlemenu, 'stage_intro', ingame or stage_clear)
# Build cartridge ('titlemenu', 'stage_intro', 'ingame' or 'stage_clear')
# metadata really counts for the entry cartridge (titlemenu)
"$picoboots_scripts_path/build_cartridge.sh" \
"$game_src_path" main_${cartridge_suffix}.lua \
Expand Down
2 changes: 1 addition & 1 deletion data/builtin_data_ingame.p8
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ __gfx__
00700700777777777777777777777777777777777777000000000000000000000000000000007777777777777777777777777777770000000000007777777777
00000000777777777777777777777777777777777777777777777777000000000000000077777777777777777777777777777777777700000000777777777777
00000000777777777777777777777777777777777777777777777777777700000000777777777777777777777777777777777777777777000077777777777777
70000000700000000000000000000000000000070000000700000007777777777777777770000000000000000000000000007777777777770077777777777700
70000000700000000000000000000000000000070000000700000000777777777777777700000000000000000000000000007777777777770077777777777700
77000000770000000000000000000000000000770000007700000007077777777777777070000000000000000000000000007777777777770077777777777700
77700000777700000000000000000000000077770000077700000007077777777777777070000000000077777777777700007777777777770077777777777700
77770000777770000000000000000000000777770000777700000077007777777777770077000000000077777777777700007777777777770077777777777700
Expand Down
10 changes: 8 additions & 2 deletions data/builtin_data_stage_clear.p8
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ __map__
__sfx__
011000003005032050300503205030050320503005032050300503205030050320503005032050300503205030050320503005032050300503205030050320503005032050300503205030050320503005032050
010c00001835018350183501835018350183501835018350183501835018350183501835018350183501835018350183501835018350183501835018350183501835018350183501835018350183501835018350
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000a0000326203c610346202b630206301c620226102f62037630326302b6202461021620286203463030630376203162033610296202f6300060000600006000060000600006000060000600006000060000600
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
Expand Down Expand Up @@ -225,7 +225,13 @@ __sfx__
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
010400002d8502d800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000400002d8502d800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0002000027a102da3031a4034a5037a503aa503aa5039a5038a5036a5031a402ca4024a401fa401ba3017a3014a3011a200ea200da200ba1009a1008a1007a1006a1005a1004a1003a1003a1003a1003a0000a00
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
010e000024755267552875526755280502975528050297552b050290502f050300503004030030300203001500000000000000000000000000000000000000000000000000000000000000000000000000000000
__music__
00 08090c0d
04 0a0b4040

24 changes: 12 additions & 12 deletions data/data_stage1_runtime.p8
Original file line number Diff line number Diff line change
Expand Up @@ -104,18 +104,18 @@ eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
eeeeeeeecceeeeeeeeeeeecccceeeeeeeeeeeecccceeeeeeeeeeeecccceeeeeeeeeeeecccceeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
eeeeeeccccceeeeeeeeeccccccceeeeeeeeec777ccceeeeeeeeeccccccceeeeeeeeeccccccceeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
eeeecccccccceeeeeeeccccc7ccceeeeeeecccc77ccceeeeeeeccccc7ccceeeeeeeccccc7ccceeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
eeccccc77ccceeeeeecccc777ccceeeeeecccc777ccceeeeeecccc777cc7eeeeeecccc777ccceeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
ecccccc77ccceeeeec77ccc777cceeeeeccccc7777cceeeeecccccc77777eeeeecccccc777cceeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
eccccccccccceeeee7777cc7cccceeeeeccccc77cccceeeeecccccc7c777eeeeecccccc7cccceeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
ccccccccccceeeee77ccc7ccccceeeeeccccc7ccccceeeeeccccc7c7777eeeeeccccc7ccccceeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
ccccccccccceeeee7cccccccccceeeeeccccccccccceeeeeccccccccccceeeeeccccccccccceeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
cccccccccceeeeeecccccccccceeeeeecccccccccceeeeeecccccccccceeeeeeccccc7cc7ceeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
cccccccceeeeeeeeccccccccceeeeeeeccccccccceeeeeeeccccccccceeeeeeeccccc777ceeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
eccccceeeeeeeeeeeccccccceeeeeeeeeccccccceeeeeeeeeccccccceeeeeeeeeccccc77eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
eecceeeeeeeeeeeeeecccceeeeeeeeeeeecccceeeeeeeeeeeecccceeeeeeeeeeeecccceeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
Expand Down
2 changes: 1 addition & 1 deletion data/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.3
5.4
55 changes: 45 additions & 10 deletions export_and_patch_cartridge_release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,50 @@
picoboots_scripts_path="$(dirname "$0")/pico-boots/scripts"
game_scripts_path="$(dirname "$0")"
data_path="$(dirname "$0")/data"
local_plates_path="$(dirname "$0")/plates"
# Linux only
carts_dirpath="$HOME/.lexaloffle/pico-8/carts"
config_plates_dirpath="$HOME/.lexaloffle/pico-8/plates"

# Configuration: cartridge
version=`cat "$data_path/version.txt"`
export_folder="$carts_dirpath/picosonic/v${version}_release"
cartridge_basename="picosonic_v${version}_release"

# Verify that the export folder is present. This does not guarantee we built and installed all cartridges
# to carts correctly, but if not present don't even try to export.
if [[ ! -d "$export_folder" ]]; then
echo "No directory found at $export_folder. Make sure to build and install the cartridges in release first. STOP."
exit 1
fi

# Configuration: sub-directories
rel_p8_folder="${cartridge_basename}_cartridges"
rel_png_folder="${cartridge_basename}_png_cartridges"
rel_bin_folder="${cartridge_basename}.bin"
rel_web_folder="${cartridge_basename}_web"

p8_folder="${export_folder}/${rel_p8_folder}"
png_folder="${export_folder}/${rel_png_folder}"
bin_folder="${export_folder}/${rel_bin_folder}"
web_folder="${export_folder}/${rel_web_folder}"

# Cleanup p8 folder in case old extra cartridges remain that would not be overwritten
rm -rf "${p8_folder}/"*

# Cleanup png folder as PICO-8 will prompt before overwriting an existing cartridge with the same name,
# and we cannot reply "y" to prompt in headless script (and png tends to keep old label when overwritten)
# Note that we prefer deleting folder content than folder, to avoid file browser/terminal sometimes
# continuing to show old folder in system bin. Make sure to place blob * outside ""
rm -rf "${export_folder}/${rel_png_folder}/"*
rm -rf "${png_folder}/"*

# Cleanup bin folder as a bug in PICO-8 makes it accumulate files in .zip for each export (even homonymous files!)
# and we want to remove any extraneous files too
rm -rf "${export_folder}/${rel_bin_folder}/"*
rm -rf "${bin_folder}/"*

# p8 cartridges can be distributed as such, so just copy them to the folder to zip later
mkdir -p "$p8_folder"
cp "${export_folder}/"*.p8 "$p8_folder"

# Create a variant of each non-data cartridge for PNG export, that reloads .p8.png instead of .p8
adapt_for_png_cmd="python3.6 \"$picoboots_scripts_path/adapt_for_png.py\" "${export_folder}/picosonic_*.p8
Expand All @@ -42,6 +67,10 @@ if [[ $? -ne 0 ]]; then
exit 1
fi

# Copy custom template to PICO-8 config plates folder as "picosonic_template.html"
# (just to avoid conflicts with other games)
cp "${local_plates_path}/custom_template.html" "${config_plates_dirpath}/picosonic_template.html"

# Export via PICO-8 editor: PNG cartridges, binaries, HTML
pico8 -x "$game_scripts_path/export_game_release.p8"

Expand All @@ -52,21 +81,19 @@ if [[ $? -ne 0 ]]; then
fi

# ingame is the biggest cartridge so if PNG export fails, this one will fail first
if [[ ! -f "${export_folder}/${rel_png_folder}/picosonic_ingame.p8.png" ]]; then
if [[ ! -f "${png_folder}/picosonic_ingame.p8.png" ]]; then
echo ""
echo "Exporting PNG cartridge for ingame via PICO-8 failed, STOP. Check that this cartridge compressed size <= 100% even after adding '.png' for reload."
exit 1
fi

# Patch the runtime binaries in-place with 4x_token, fast_reload, fast_load (experimental) if available
bin_folder="${export_folder}/${rel_bin_folder}"

if [[ ! $(ls -A "$bin_folder") ]]; then
if [[ ! -d "$bin_folder" || ! $(ls -A "$bin_folder") ]]; then
echo ""
echo "Exporting game release binaries via PICO-8 failed, STOP. Check that each cartridge compressed size <= 100%."
exit 1
fi

# Patch the runtime binaries in-place with 4x_token, fast_reload, fast_load (experimental) if available
patch_bin_cmd="\"$picoboots_scripts_path/patch_pico8_runtime.sh\" --inplace \"$bin_folder\" \"$cartridge_basename\""
echo "> $patch_bin_cmd"
bash -c "$patch_bin_cmd"
Expand All @@ -78,11 +105,11 @@ if [[ $? -ne 0 ]]; then
fi

# Rename HTML file to index.html for direct play-in-browser
html_filepath="${export_folder}/${rel_web_folder}/${cartridge_basename}.html"
mv "$html_filepath" "${export_folder}/${rel_web_folder}/index.html"
html_filepath="${web_folder}/${cartridge_basename}.html"
mv "$html_filepath" "${web_folder}/index.html"

# Patch the HTML export in-place with 4x_token, fast_reload
js_filepath="${export_folder}/${rel_web_folder}/${cartridge_basename}.js"
js_filepath="${web_folder}/${cartridge_basename}.js"
patch_js_cmd="python3.6 \"$picoboots_scripts_path/patch_pico8_js.py\" \"$js_filepath\" \"$js_filepath\""
echo "> $patch_js_cmd"
bash -c "$patch_js_cmd"
Expand All @@ -102,6 +129,14 @@ fi
# Note that for OSX, the .app folder is at the same time the app and the top-level element.
pushd "${export_folder}"

# P8 cartridges archive (delete existing one to be safe)
rm -f "${cartridge_basename}_cartridges.zip"
zip -r "${cartridge_basename}_cartridges.zip" "$rel_p8_folder"

# PNG cartridges archive (delete existing one to be safe)
rm -f "${cartridge_basename}_png_cartridges.zip"
zip -r "${cartridge_basename}_png_cartridges.zip" "$rel_png_folder"

# PNG cartridges archive (delete existing one to be safe)
rm -f "${cartridge_basename}_png_cartridges.zip"
zip -r "${cartridge_basename}_png_cartridges.zip" "$rel_png_folder"
Expand Down
7 changes: 5 additions & 2 deletions export_game_release.p8
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ __lua__
-- Note that it will not warn if cartridge is not found.
-- Paths are relative to PICO-8 carts directory.

-- #version
-- PICO-8 cannot read data/version.txt, so exceptionally set the version manually here
local version = "5.3"
local version = "5.4"
local export_folder = "picosonic/v"..version.."_release"
local game_basename = "picosonic_v"..version.."_release"
local rel_png_folder = game_basename.."_png_cartridges"
Expand Down Expand Up @@ -102,7 +103,9 @@ cd(export_folder)
mkdir(game_basename.."_web")
-- Do not cd into game_basename.."_web" because we want the additional cartridges to be accessible
-- in current path. Instead, export directly into the _web folder
export(game_basename.."_web/"..game_basename..".html "..additional_cartridges_string.." -i 46 -s 2 -c 14")
-- Use custom template. It is located in plates/picosonic_template.html and copied into PICO-8 config dir plates
-- in export_and_patch_cartridge_release.sh
export(game_basename.."_web/"..game_basename..".html "..additional_cartridges_string.." -i 46 -s 2 -c 14 -p picosonic_template")
printh("Exported HTML in carts/"..export_folder.."/"..game_basename..".html")

cd("..")
Loading

0 comments on commit 5a40436

Please sign in to comment.