-
-
Notifications
You must be signed in to change notification settings - Fork 88
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1072 from tabreturn/push
Push!
- Loading branch information
Showing
7 changed files
with
147 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
#!/bin/bash | ||
|
||
XDG_DATA_HOME=${XDG_DATA_HOME:-$HOME/.local/share} | ||
|
||
if [ -d "/opt/system/Tools/PortMaster/" ]; then | ||
controlfolder="/opt/system/Tools/PortMaster" | ||
elif [ -d "/opt/tools/PortMaster/" ]; then | ||
controlfolder="/opt/tools/PortMaster" | ||
elif [ -d "$XDG_DATA_HOME/PortMaster/" ]; then | ||
controlfolder="$XDG_DATA_HOME/PortMaster" | ||
else | ||
controlfolder="/roms/ports/PortMaster" | ||
fi | ||
|
||
source $controlfolder/control.txt | ||
[ -f "${controlfolder}/mod_${CFW_NAME}.txt" ] && source "${controlfolder}/mod_${CFW_NAME}.txt" | ||
getcontrols | ||
|
||
GAMEDIR="/$directory/ports/push" | ||
CONFDIR="$GAMEDIR/conf" | ||
PYXEL_PKG="main.py" | ||
|
||
cd "${GAMEDIR}" | ||
|
||
> "${GAMEDIR}/log.txt" && exec > >(tee "${GAMEDIR}/log.txt") 2>&1 | ||
|
||
mkdir -p "$GAMEDIR/conf" | ||
bind_directories "$HOME/.config/.pyxel/push" "$CONFDIR" | ||
|
||
# Load Pyxel runtime | ||
runtime="pyxel_2.2.8_python_3.11" | ||
export pyxel_dir="$HOME/pyxel" | ||
mkdir -p "${pyxel_dir}" | ||
|
||
# Patch game | ||
if [ -f "./gamedata/push.pyxapp" ]; then | ||
pm_message "Patching game files ..." | ||
unzip "./gamedata/push.pyxapp" -d "./gamedata" | ||
mv ./gamedata/push/{*,.*} ./gamedata/ 2>/dev/null | ||
rmdir ./gamedata/push | ||
rm ./gamedata/push.pyxapp | ||
python patch.py | ||
pm_message "Patching complete" | ||
fi | ||
|
||
if [ ! -f "$controlfolder/libs/${runtime}.squashfs" ]; then | ||
# Check for runtime if not downloaded via PM | ||
if [ ! -f "$controlfolder/harbourmaster" ]; then | ||
pm_message "This port requires the latest PortMaster to run, please go to https://portmaster.games/ for more info." | ||
sleep 5 | ||
exit 1 | ||
fi | ||
|
||
$ESUDO $controlfolder/harbourmaster --quiet --no-check runtime_check "${runtime}.squashfs" | ||
fi | ||
|
||
if [[ "$PM_CAN_MOUNT" != "N" ]]; then | ||
$ESUDO umount "${pyxel_dir}" | ||
fi | ||
|
||
$ESUDO mount "$controlfolder/libs/${runtime}.squashfs" "${pyxel_dir}" | ||
|
||
export SDL_GAMECONTROLLERCONFIG="$sdl_controllerconfig" | ||
|
||
$GPTOKEYB "pyxel" & | ||
|
||
pm_platform_helper "${pyxel_dir}/bin/pyxel" | ||
|
||
# Enable Pyxel virtual env | ||
source "${pyxel_dir}/bin/activate" | ||
export PYTHONHOME="${pyxel_dir}" | ||
export PYTHONPYCACHEPREFIX="${GAMEDIR}/${runtime}.cache" | ||
|
||
"${pyxel_dir}/bin/pyxel" run "${GAMEDIR}/gamedata/${PYXEL_PKG}" | ||
|
||
if [[ "$PM_CAN_MOUNT" != "N" ]]; then | ||
$ESUDO umount "${pyxel_dir}" | ||
fi | ||
|
||
pm_finish |
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,12 @@ | ||
## Notes | ||
|
||
Thanks [yuta](https://helpcomputer.itch.io) (HZ3 Software) for creating this fantastic game, which you can download free at [https://yyuta342.itch.io/push](https://yyuta342.itch.io/push) | ||
|
||
|
||
## Controls | ||
|
||
| Button | Action | | ||
| ------ | -------- | | ||
| D-PAD | Movement | | ||
| A | Select | | ||
| Y | Menu | |
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,13 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<gameList> | ||
<game> | ||
<path>./Push!.sh</path> | ||
<name>Push!</name> | ||
<desc>A simple game in which you control a rabbit and eat carrots. If there is a hole, you cannot pass through it as it is, so push the rocks to fill the hole and make a path.</desc> | ||
<releasedate>20241212T000000</releasedate> | ||
<developer>yuta</developer> | ||
<publisher>HZ3 Software</publisher> | ||
<genre>Puzzle</genre> | ||
<image>./push/screenshot.png</image> | ||
</game> | ||
</gameList> |
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,28 @@ | ||
{ | ||
"version": 3, | ||
"name": "push.zip", | ||
"items": [ | ||
"Push!.sh", | ||
"push" | ||
], | ||
"items_opt": null, | ||
"attr": { | ||
"title": "Push!", | ||
"porter": [ | ||
"tabreturn" | ||
], | ||
"desc": "A simple game in which you control a rabbit and eat carrots. If there is a hole, you cannot pass through it as it is, so push the rocks to fill the hole and make a path.", | ||
"desc_md": null, | ||
"inst": "Download the game free at https://yyuta342.itch.io/push, and place the push.pyxapp file in the push/gamedata folder.", | ||
"inst_md": "Download the game free at [https://yyuta342.itch.io/push](https://yyuta342.itch.io/push), and place the *push.pyxapp* file in the `push/gamedata` folder.", | ||
"genres": [ | ||
"puzzle" | ||
], | ||
"image": {}, | ||
"rtr": false, | ||
"exp": false, | ||
"runtime": "pyxel_2.2.8_python_3.11.squashfs", | ||
"reqs": [], | ||
"arch": [] | ||
} | ||
} |
Empty file.
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,14 @@ | ||
import re | ||
|
||
s_levels = "./gamedata/s_levels.py" | ||
with open(s_levels, "r") as file: | ||
content = file.read() | ||
|
||
content = re.sub( | ||
r'self\.level_title = f"LEVEL {self\.map_json\[self\.level_index\]\["title"\]}"', | ||
'level_data = self.map_json[self.level_index]; self.level_title = f"LEVEL {level_data[\'title\']}"', | ||
content, | ||
) | ||
|
||
with open(s_levels, "w") as file: | ||
file.write(content) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.