Compare commits
29 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a1d37a1a0b | |||
| 9066b2cdbc | |||
| 238b5aac6a | |||
| 8e5ec9fef0 | |||
| 6ca2e01fba | |||
| 8cf30cd78d | |||
| 9b441fa35c | |||
| 61ca537909 | |||
| 0a82aea922 | |||
| f41c550bb8 | |||
| 829462d3b6 | |||
| 002da46045 | |||
| cfa73c58a8 | |||
| 5728effcc6 | |||
| fa1a0175b0 | |||
| 85edb18380 | |||
| 3a535ee04f | |||
| 9b31b392d2 | |||
| 999fa14059 | |||
| e925376b7a | |||
| 2596034365 | |||
| 163855b6e7 | |||
| 645d48aeae | |||
| ec800a88fc | |||
| abc37dee4e | |||
| 1ae7839275 | |||
| d976d1bc59 | |||
| 531a5b5d05 | |||
| 67713fab06 |
@@ -1,12 +1,16 @@
|
||||
[target.'cfg(target_os = "emscripten")']
|
||||
# TODO: Document what the fuck this is.
|
||||
rustflags = [
|
||||
# "-O", "-C", "link-args=-O2 --profiling",
|
||||
#"-C", "link-args=-O3 --closure 1",
|
||||
# "-C", "link-args=-g -gsource-map",
|
||||
"-C", "link-args=-sASYNCIFY -sALLOW_MEMORY_GROWTH=1",
|
||||
# "-C", "link-args=-sALLOW_MEMORY_GROWTH=1",
|
||||
# Stack size is required for this project, it will crash otherwise.
|
||||
"-C", "link-args=-sASYNCIFY=1 -sASYNCIFY_STACK_SIZE=8192 -sALLOW_MEMORY_GROWTH=1",
|
||||
"-C", "link-args=-sUSE_SDL=2 -sUSE_SDL_IMAGE=2 -sUSE_SDL_MIXER=2 -sUSE_OGG=1 -sUSE_SDL_GFX=2 -sUSE_SDL_TTF=2 -sSDL2_IMAGE_FORMATS=['png']",
|
||||
# USE_OGG, USE_VORBIS for OGG/VORBIS usage
|
||||
"-C", "link-args=--preload-file assets/game/",
|
||||
]
|
||||
|
||||
[target.'cfg(target_os = "linux")']
|
||||
rustflags = [
|
||||
# Manually link zlib.
|
||||
# The `sdl2` crate's build script uses `libpng`, which requires `zlib`.
|
||||
# By adding `-lz` here, we ensure it's passed to the linker after `libpng`,
|
||||
# which is required for the linker to correctly resolve symbols.
|
||||
"-C", "link-arg=-lz",
|
||||
]
|
||||
30
.github/workflows/build.yaml
vendored
@@ -11,8 +11,6 @@ env:
|
||||
jobs:
|
||||
build:
|
||||
name: Build (${{ matrix.target }})
|
||||
env:
|
||||
VCPKG_SYSTEM_LIBRARIES: "OFF"
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
@@ -23,6 +21,9 @@ jobs:
|
||||
- os: macos-13
|
||||
target: x86_64-apple-darwin
|
||||
artifact_name: pacman
|
||||
- os: macos-latest
|
||||
target: aarch64-apple-darwin
|
||||
artifact_name: pacman
|
||||
- os: windows-latest
|
||||
target: x86_64-pc-windows-gnu
|
||||
artifact_name: pacman.exe
|
||||
@@ -44,15 +45,15 @@ jobs:
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: target/vcpkg
|
||||
key: ${{ runner.os }}-vcpkg-${{ hashFiles('Cargo.toml', 'Cargo.lock') }}
|
||||
key: A-vcpkg-${{ runner.os }}-${{ matrix.target }}-${{ hashFiles('Cargo.toml', 'Cargo.lock') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-vcpkg-
|
||||
A-vcpkg-${{ runner.os }}-${{ matrix.target }}-
|
||||
|
||||
- name: Vcpkg Linux Dependencies
|
||||
if: runner.os == 'Linux'
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y build-essential gettext libltdl-dev
|
||||
sudo apt-get install -y libltdl-dev
|
||||
|
||||
- name: Vcpkg
|
||||
run: |
|
||||
@@ -88,7 +89,7 @@ jobs:
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Emscripten SDK
|
||||
uses: mymindstorm/setup-emsdk@v14
|
||||
uses: pyodide/setup-emsdk@v15
|
||||
with:
|
||||
version: 3.1.43
|
||||
actions-cache-folder: "emsdk-cache"
|
||||
@@ -108,8 +109,21 @@ jobs:
|
||||
version: 8
|
||||
run_install: true
|
||||
|
||||
- name: Build
|
||||
run: ./build.sh -er # release mode, skip emsdk
|
||||
- name: Build with Emscripten
|
||||
run: |
|
||||
cargo build --target=wasm32-unknown-emscripten --release
|
||||
|
||||
- name: Assemble
|
||||
run: |
|
||||
echo "Generating CSS"
|
||||
pnpx postcss-cli ./assets/site/styles.scss -o ./assets/site/build.css
|
||||
|
||||
echo "Copying WASM files"
|
||||
|
||||
mkdir -p dist
|
||||
cp assets/site/{build.css,favicon.ico,index.html} dist
|
||||
output_folder="target/wasm32-unknown-emscripten/release"
|
||||
cp $output_folder/pacman.{wasm,js} $output_folder/deps/pacman.data dist
|
||||
|
||||
- name: Upload Artifact
|
||||
uses: actions/upload-pages-artifact@v3
|
||||
|
||||
88
Cargo.lock
generated
@@ -108,6 +108,12 @@ dependencies = [
|
||||
"num-traits",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "itoa"
|
||||
version = "1.0.15"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c"
|
||||
|
||||
[[package]]
|
||||
name = "lazy_static"
|
||||
version = "1.5.0"
|
||||
@@ -174,7 +180,7 @@ checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39"
|
||||
|
||||
[[package]]
|
||||
name = "pacman"
|
||||
version = "0.1.0"
|
||||
version = "0.2.0"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"glam",
|
||||
@@ -184,6 +190,8 @@ dependencies = [
|
||||
"pathfinding",
|
||||
"rand",
|
||||
"sdl2",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"spin_sleep",
|
||||
"thiserror 1.0.69",
|
||||
"tracing",
|
||||
@@ -212,15 +220,6 @@ version = "0.2.13"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58"
|
||||
|
||||
[[package]]
|
||||
name = "ppv-lite86"
|
||||
version = "0.2.21"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9"
|
||||
dependencies = [
|
||||
"zerocopy",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "proc-macro2"
|
||||
version = "1.0.95"
|
||||
@@ -251,17 +250,6 @@ version = "0.9.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "6db2770f06117d490610c7488547d543617b21bfa07796d7a12f6f1bd53850d1"
|
||||
dependencies = [
|
||||
"rand_chacha",
|
||||
"rand_core",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rand_chacha"
|
||||
version = "0.9.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb"
|
||||
dependencies = [
|
||||
"ppv-lite86",
|
||||
"rand_core",
|
||||
]
|
||||
|
||||
@@ -324,6 +312,12 @@ version = "2.1.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d"
|
||||
|
||||
[[package]]
|
||||
name = "ryu"
|
||||
version = "1.0.20"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f"
|
||||
|
||||
[[package]]
|
||||
name = "sdl2"
|
||||
version = "0.38.0"
|
||||
@@ -355,6 +349,38 @@ version = "1.0.26"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "56e6fa9c48d24d85fb3de5ad847117517440f6beceb7798af16b4a87d616b8d0"
|
||||
|
||||
[[package]]
|
||||
name = "serde"
|
||||
version = "1.0.219"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6"
|
||||
dependencies = [
|
||||
"serde_derive",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "serde_derive"
|
||||
version = "1.0.219"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "serde_json"
|
||||
version = "1.0.141"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "30b9eff21ebe718216c6ec64e1d9ac57087aad11efc64e32002bce4a0d4c03d3"
|
||||
dependencies = [
|
||||
"itoa",
|
||||
"memchr",
|
||||
"ryu",
|
||||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "sharded-slab"
|
||||
version = "0.1.4"
|
||||
@@ -647,23 +673,3 @@ checksum = "6f42320e61fe2cfd34354ecb597f86f413484a798ba44a8ca1165c58d42da6c1"
|
||||
dependencies = [
|
||||
"bitflags 2.9.1",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "zerocopy"
|
||||
version = "0.8.26"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1039dd0d3c310cf05de012d8a39ff557cb0d23087fd44cad61df08fc31907a2f"
|
||||
dependencies = [
|
||||
"zerocopy-derive",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "zerocopy-derive"
|
||||
version = "0.8.26"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9ecf5b4cc5364572d7f4c329661bcc82724222973f2cab6f050a4e5c22f75181"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn",
|
||||
]
|
||||
|
||||
15
Cargo.toml
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "pacman"
|
||||
version = "0.1.0"
|
||||
version = "0.2.0"
|
||||
edition = "2021"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
@@ -12,12 +12,20 @@ tracing-subscriber = {version = "0.3.17", features = ["env-filter"]}
|
||||
lazy_static = "1.5.0"
|
||||
sdl2 = { version = "0.38.0", features = ["image", "ttf"] }
|
||||
spin_sleep = "1.3.2"
|
||||
rand = "0.9.2"
|
||||
rand = { version = "0.9.2", default-features = false, features = ["small_rng", "os_rng"] }
|
||||
pathfinding = "4.14"
|
||||
once_cell = "1.21.3"
|
||||
thiserror = "1.0"
|
||||
anyhow = "1.0"
|
||||
glam = "0.30.4"
|
||||
serde = { version = "1.0.219", features = ["derive"] }
|
||||
serde_json = "1.0.141"
|
||||
|
||||
[profile.release]
|
||||
lto = true
|
||||
panic = "abort"
|
||||
panic-strategy = "abort"
|
||||
opt-level = "z"
|
||||
|
||||
[target.'cfg(target_os = "windows")'.dependencies.winapi]
|
||||
version = "0.3"
|
||||
@@ -42,7 +50,8 @@ rev = "2024.05.24" # release 2024.05.24 # to check for a new one, check https://
|
||||
[package.metadata.vcpkg.target]
|
||||
x86_64-pc-windows-msvc = { triplet = "x64-windows-static-md" }
|
||||
x86_64-unknown-linux-gnu = { triplet = "x64-linux" }
|
||||
# x86_64-apple-darwin = { triplet = "x64-osx-release" }
|
||||
x86_64-apple-darwin = { triplet = "x64-osx" }
|
||||
aarch64-apple-darwin = { triplet = "arm64-osx" }
|
||||
|
||||
[target.'cfg(target_os = "emscripten")'.dependencies]
|
||||
libc = "0.2.16"
|
||||
|
||||
|
Before Width: | Height: | Size: 174 B |
|
Before Width: | Height: | Size: 158 B |
|
Before Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 528 B |
|
Before Width: | Height: | Size: 394 B |
|
Before Width: | Height: | Size: 228 B |
|
Before Width: | Height: | Size: 370 B |
1121
assets/game/atlas.json
Normal file
BIN
assets/game/atlas.png
Normal file
|
After Width: | Height: | Size: 23 KiB |
BIN
assets/unpacked/cutscene/general_6_10.png
Normal file
|
After Width: | Height: | Size: 120 B |
BIN
assets/unpacked/cutscene/general_6_11.png
Normal file
|
After Width: | Height: | Size: 120 B |
BIN
assets/unpacked/cutscene/general_6_12.png
Normal file
|
After Width: | Height: | Size: 116 B |
BIN
assets/unpacked/cutscene/general_6_9.png
Normal file
|
After Width: | Height: | Size: 115 B |
BIN
assets/unpacked/cutscene/general_7_10.png
Normal file
|
After Width: | Height: | Size: 192 B |
BIN
assets/unpacked/cutscene/general_7_11.png
Normal file
|
After Width: | Height: | Size: 187 B |
BIN
assets/unpacked/cutscene/general_7_8.png
Normal file
|
After Width: | Height: | Size: 196 B |
BIN
assets/unpacked/cutscene/general_7_9.png
Normal file
|
After Width: | Height: | Size: 215 B |
BIN
assets/unpacked/cutscene/general_8_10.png
Normal file
|
After Width: | Height: | Size: 107 B |
BIN
assets/unpacked/cutscene/general_8_11.png
Normal file
|
After Width: | Height: | Size: 189 B |
BIN
assets/unpacked/cutscene/general_8_8.png
Normal file
|
After Width: | Height: | Size: 115 B |
BIN
assets/unpacked/cutscene/general_8_9.png
Normal file
|
After Width: | Height: | Size: 195 B |
BIN
assets/unpacked/cutscene/general_9_10.png
Normal file
|
After Width: | Height: | Size: 177 B |
BIN
assets/unpacked/cutscene/general_9_11.png
Normal file
|
After Width: | Height: | Size: 177 B |
BIN
assets/unpacked/cutscene/general_9_8.png
Normal file
|
After Width: | Height: | Size: 125 B |
BIN
assets/unpacked/cutscene/general_9_9.png
Normal file
|
After Width: | Height: | Size: 122 B |
BIN
assets/unpacked/edible/apple.png
Normal file
|
After Width: | Height: | Size: 173 B |
BIN
assets/unpacked/edible/bell.png
Normal file
|
After Width: | Height: | Size: 175 B |
BIN
assets/unpacked/edible/cherry.png
Normal file
|
After Width: | Height: | Size: 213 B |
BIN
assets/unpacked/edible/galaxian.png
Normal file
|
After Width: | Height: | Size: 178 B |
BIN
assets/unpacked/edible/key.png
Normal file
|
After Width: | Height: | Size: 162 B |
BIN
assets/unpacked/edible/melon.png
Normal file
|
After Width: | Height: | Size: 210 B |
BIN
assets/unpacked/edible/orange.png
Normal file
|
After Width: | Height: | Size: 177 B |
BIN
assets/unpacked/edible/strawberry.png
Normal file
|
After Width: | Height: | Size: 195 B |
BIN
assets/unpacked/effects/100.png
Normal file
|
After Width: | Height: | Size: 136 B |
BIN
assets/unpacked/effects/1000.png
Normal file
|
After Width: | Height: | Size: 137 B |
BIN
assets/unpacked/effects/1600.png
Normal file
|
After Width: | Height: | Size: 147 B |
BIN
assets/unpacked/effects/200.png
Normal file
|
After Width: | Height: | Size: 139 B |
BIN
assets/unpacked/effects/2000.png
Normal file
|
After Width: | Height: | Size: 148 B |
BIN
assets/unpacked/effects/300.png
Normal file
|
After Width: | Height: | Size: 149 B |
BIN
assets/unpacked/effects/3000.png
Normal file
|
After Width: | Height: | Size: 152 B |
BIN
assets/unpacked/effects/400.png
Normal file
|
After Width: | Height: | Size: 135 B |
BIN
assets/unpacked/effects/500.png
Normal file
|
After Width: | Height: | Size: 150 B |
BIN
assets/unpacked/effects/5000.png
Normal file
|
After Width: | Height: | Size: 151 B |
BIN
assets/unpacked/effects/700.png
Normal file
|
After Width: | Height: | Size: 145 B |
BIN
assets/unpacked/effects/800.png
Normal file
|
After Width: | Height: | Size: 135 B |
BIN
assets/unpacked/ghost/blinky/down_a.png
Normal file
|
After Width: | Height: | Size: 181 B |
BIN
assets/unpacked/ghost/blinky/down_b.png
Normal file
|
After Width: | Height: | Size: 178 B |
BIN
assets/unpacked/ghost/blinky/left_a.png
Normal file
|
After Width: | Height: | Size: 184 B |
BIN
assets/unpacked/ghost/blinky/left_b.png
Normal file
|
After Width: | Height: | Size: 181 B |
BIN
assets/unpacked/ghost/blinky/right_a.png
Normal file
|
After Width: | Height: | Size: 183 B |
BIN
assets/unpacked/ghost/blinky/right_b.png
Normal file
|
After Width: | Height: | Size: 181 B |
BIN
assets/unpacked/ghost/blinky/up_a.png
Normal file
|
After Width: | Height: | Size: 177 B |
BIN
assets/unpacked/ghost/blinky/up_b.png
Normal file
|
After Width: | Height: | Size: 175 B |
BIN
assets/unpacked/ghost/clyde/down_a.png
Normal file
|
After Width: | Height: | Size: 189 B |
BIN
assets/unpacked/ghost/clyde/down_b.png
Normal file
|
After Width: | Height: | Size: 187 B |
BIN
assets/unpacked/ghost/clyde/left_a.png
Normal file
|
After Width: | Height: | Size: 194 B |
BIN
assets/unpacked/ghost/clyde/left_b.png
Normal file
|
After Width: | Height: | Size: 191 B |
BIN
assets/unpacked/ghost/clyde/right_a.png
Normal file
|
After Width: | Height: | Size: 194 B |
BIN
assets/unpacked/ghost/clyde/right_b.png
Normal file
|
After Width: | Height: | Size: 190 B |
BIN
assets/unpacked/ghost/clyde/up_a.png
Normal file
|
After Width: | Height: | Size: 184 B |
BIN
assets/unpacked/ghost/clyde/up_b.png
Normal file
|
After Width: | Height: | Size: 179 B |
BIN
assets/unpacked/ghost/eyes/down.png
Normal file
|
After Width: | Height: | Size: 127 B |
BIN
assets/unpacked/ghost/eyes/left.png
Normal file
|
After Width: | Height: | Size: 135 B |
BIN
assets/unpacked/ghost/eyes/right.png
Normal file
|
After Width: | Height: | Size: 134 B |
BIN
assets/unpacked/ghost/eyes/up.png
Normal file
|
After Width: | Height: | Size: 134 B |
BIN
assets/unpacked/ghost/frightened/blue_a.png
Normal file
|
After Width: | Height: | Size: 190 B |
BIN
assets/unpacked/ghost/frightened/blue_b.png
Normal file
|
After Width: | Height: | Size: 186 B |
BIN
assets/unpacked/ghost/frightened/white_a.png
Normal file
|
After Width: | Height: | Size: 183 B |
BIN
assets/unpacked/ghost/frightened/white_b.png
Normal file
|
After Width: | Height: | Size: 183 B |
BIN
assets/unpacked/ghost/inky/down_a.png
Normal file
|
After Width: | Height: | Size: 177 B |
BIN
assets/unpacked/ghost/inky/down_b.png
Normal file
|
After Width: | Height: | Size: 175 B |
BIN
assets/unpacked/ghost/inky/left_a.png
Normal file
|
After Width: | Height: | Size: 183 B |
BIN
assets/unpacked/ghost/inky/left_b.png
Normal file
|
After Width: | Height: | Size: 180 B |
BIN
assets/unpacked/ghost/inky/right_a.png
Normal file
|
After Width: | Height: | Size: 182 B |
BIN
assets/unpacked/ghost/inky/right_b.png
Normal file
|
After Width: | Height: | Size: 179 B |
BIN
assets/unpacked/ghost/inky/up_a.png
Normal file
|
After Width: | Height: | Size: 173 B |
BIN
assets/unpacked/ghost/inky/up_b.png
Normal file
|
After Width: | Height: | Size: 172 B |
BIN
assets/unpacked/ghost/pinky/down_a.png
Normal file
|
After Width: | Height: | Size: 182 B |
BIN
assets/unpacked/ghost/pinky/down_b.png
Normal file
|
After Width: | Height: | Size: 179 B |
BIN
assets/unpacked/ghost/pinky/left_a.png
Normal file
|
After Width: | Height: | Size: 190 B |
BIN
assets/unpacked/ghost/pinky/left_b.png
Normal file
|
After Width: | Height: | Size: 187 B |
BIN
assets/unpacked/ghost/pinky/right_a.png
Normal file
|
After Width: | Height: | Size: 189 B |
BIN
assets/unpacked/ghost/pinky/right_b.png
Normal file
|
After Width: | Height: | Size: 185 B |
BIN
assets/unpacked/ghost/pinky/up_a.png
Normal file
|
After Width: | Height: | Size: 179 B |
BIN
assets/unpacked/ghost/pinky/up_b.png
Normal file
|
After Width: | Height: | Size: 177 B |
BIN
assets/unpacked/maze/energizer.png
Normal file
|
After Width: | Height: | Size: 2.7 KiB |
BIN
assets/unpacked/maze/full.png
Normal file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
assets/unpacked/maze/maze_0_10.png
Normal file
|
After Width: | Height: | Size: 2.7 KiB |
BIN
assets/unpacked/maze/maze_0_11.png
Normal file
|
After Width: | Height: | Size: 2.7 KiB |
BIN
assets/unpacked/maze/maze_0_12.png
Normal file
|
After Width: | Height: | Size: 2.6 KiB |