mirror of
https://github.com/Xevion/Pac-Man.git
synced 2025-12-06 01:15:42 -06:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| bfbbb71752 | |||
| 979f736f54 | |||
| 5a7f6a4c10 | |||
| b66c9ce135 | |||
| f5363516c3 |
33
.github/workflows/build.yaml
vendored
33
.github/workflows/build.yaml
vendored
@@ -6,7 +6,7 @@ permissions:
|
||||
contents: write
|
||||
|
||||
env:
|
||||
RUST_TOOLCHAIN: 1.88.0
|
||||
RUST_TOOLCHAIN: 1.86.0
|
||||
|
||||
jobs:
|
||||
wasm:
|
||||
@@ -72,19 +72,11 @@ jobs:
|
||||
- name: Vcpkg
|
||||
run: |
|
||||
cargo install cargo-vcpkg
|
||||
cargo vcpkg build
|
||||
cargo vcpkg -v build
|
||||
|
||||
- name: Build
|
||||
run: cargo build --release
|
||||
|
||||
- name: Assemble Archive
|
||||
run: |
|
||||
mkdir /tmp/example/
|
||||
cp ./target/release/pacman /tmp/example/
|
||||
chmod a+x /tmp/example/pacman
|
||||
mkdir /tmp/example/assets
|
||||
cp ./assets/TerminalVector.ttf ./assets/fruit.png /tmp/example/assets
|
||||
|
||||
- name: Install Cargo Binstall
|
||||
uses: cargo-bins/cargo-binstall@main
|
||||
|
||||
@@ -98,7 +90,7 @@ jobs:
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: "pacman-${{ env.PACKAGE_VERSION }}-${{ env.TARGET }}"
|
||||
path: /tmp/example/
|
||||
path: ./target/release/pacman
|
||||
retention-days: 7
|
||||
if-no-files-found: error
|
||||
|
||||
@@ -128,13 +120,6 @@ jobs:
|
||||
- name: Build
|
||||
run: cargo build --release
|
||||
|
||||
- name: Assemble Archive
|
||||
run: |
|
||||
mkdir /tmp/example/
|
||||
cp ./target/release/pacman /tmp/example/
|
||||
mkdir /tmp/example/assets
|
||||
cp ./assets/TerminalVector.ttf ./assets/fruit.png /tmp/example/assets
|
||||
|
||||
- name: Install Cargo Binstall
|
||||
uses: cargo-bins/cargo-binstall@main
|
||||
|
||||
@@ -148,7 +133,7 @@ jobs:
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: "pacman-${{ env.PACKAGE_VERSION }}-${{ env.TARGET }}"
|
||||
path: /tmp/example/
|
||||
path: ./target/release/pacman
|
||||
retention-days: 7
|
||||
if-no-files-found: error
|
||||
|
||||
@@ -183,14 +168,6 @@ jobs:
|
||||
- name: Build
|
||||
run: cargo build --release
|
||||
|
||||
- name: Prepare Archive
|
||||
run: |
|
||||
New-Item -Type Directory ./release/
|
||||
Move-Item -Path ./target/release/pacman.exe -Destination ./release/
|
||||
Move-Item -Path ./SDL2.dll, ./SDL2_image.dll, ./SDL2_ttf.dll, ./SDL2_mixer.dll, ./SDL2_gfx.dll -Destination ./release/
|
||||
New-Item -Type Directory ./release/assets/
|
||||
Move-Item -Path ./assets/TerminalVector.ttf, ./assets/fruit.png -Destination ./release/assets/
|
||||
|
||||
- name: Install Cargo Binstall
|
||||
uses: cargo-bins/cargo-binstall@main
|
||||
|
||||
@@ -204,6 +181,6 @@ jobs:
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: "pacman-${{ env.PACKAGE_VERSION }}-${{ env.TARGET }}"
|
||||
path: ./release/
|
||||
path: ./target/release/pacman.exe
|
||||
retention-days: 7
|
||||
if-no-files-found: error
|
||||
|
||||
@@ -35,7 +35,7 @@ default-features = false
|
||||
features = ["ttf","image","gfx","mixer","static-link","use-vcpkg"]
|
||||
|
||||
[package.metadata.vcpkg]
|
||||
dependencies = ["sdl2", "sdl2-image[libjpeg-turbo,tiff,libwebp]", "sdl2-ttf", "sdl2-gfx", "sdl2-mixer"]
|
||||
dependencies = ["sdl2", "sdl2-image", "sdl2-ttf", "sdl2-gfx", "sdl2-mixer"]
|
||||
git = "https://github.com/microsoft/vcpkg"
|
||||
rev = "2024.05.24" # release 2024.05.24 # to check for a new one, check https://github.com/microsoft/vcpkg/releases
|
||||
|
||||
|
||||
19
src/asset.rs
19
src/asset.rs
@@ -31,6 +31,25 @@ pub enum Asset {
|
||||
// Add more as needed
|
||||
}
|
||||
|
||||
impl Asset {
|
||||
pub fn path(&self) -> &str {
|
||||
use Asset::*;
|
||||
match self {
|
||||
Wav1 => "wav/1.ogg",
|
||||
Wav2 => "wav/2.ogg",
|
||||
Wav3 => "wav/3.ogg",
|
||||
Wav4 => "wav/4.ogg",
|
||||
Pacman => "32/pacman.png",
|
||||
Pellet => "24/pellet.png",
|
||||
Energizer => "24/energizer.png",
|
||||
Map => "map.png",
|
||||
FontKonami => "font/konami.ttf",
|
||||
GhostBody => "32/ghost_body.png",
|
||||
GhostEyes => "32/ghost_eyes.png",
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(not(target_os = "emscripten"))]
|
||||
mod imp {
|
||||
use super::*;
|
||||
|
||||
Reference in New Issue
Block a user