refactor: create workspace, move 'pacman' into pacman/ subfolder as workspace member
1768
pacman/Cargo.lock
generated
Normal file
95
pacman/Cargo.toml
Normal file
@@ -0,0 +1,95 @@
|
||||
[package]
|
||||
name = "pacman"
|
||||
version = "0.80.3"
|
||||
authors = ["Xevion"]
|
||||
edition = "2021"
|
||||
rust-version = "1.86.0"
|
||||
description = "A cross-platform retro Pac-Man clone, written in Rust and supported by SDL2"
|
||||
readme = true
|
||||
homepage = "https://pacman.xevion.dev"
|
||||
repository = "https://github.com/Xevion/Pac-Man"
|
||||
license = "GPL-3.0-or-later"
|
||||
keywords = ["game", "pacman", "arcade", "sdl2"]
|
||||
categories = ["games", "emulators"]
|
||||
publish = false
|
||||
exclude = ["/assets/unpacked/**", "/assets/site/**", "/bacon.toml", "/Justfile"]
|
||||
default-run = "pacman"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
bevy_ecs = "0.16.1"
|
||||
glam = "0.30.5"
|
||||
pathfinding = "4.14"
|
||||
tracing = { version = "0.1.41", features = ["max_level_trace", "release_max_level_debug"]}
|
||||
tracing-error = "0.2.0"
|
||||
tracing-subscriber = {version = "0.3.20", features = ["env-filter"]}
|
||||
time = { version = "0.3.43", features = ["formatting", "macros"] }
|
||||
thiserror = "2.0.16"
|
||||
anyhow = "1.0"
|
||||
smallvec = "1.15.1"
|
||||
bitflags = "2.9.4"
|
||||
micromap = "0.1.0"
|
||||
circular-buffer = "=1.1.0"
|
||||
parking_lot = "0.12.3"
|
||||
strum = "0.27.2"
|
||||
strum_macros = "0.27.2"
|
||||
thousands = "0.2.0"
|
||||
num-width = "0.1.0"
|
||||
# While not actively used in code, `build.rs` generates code that relies on this. Keep the versions synchronized.
|
||||
phf = { version = "0.13.1", features = ["macros"] }
|
||||
|
||||
# Windows-specific dependencies
|
||||
[target.'cfg(windows)'.dependencies]
|
||||
# Used for customizing console output on Windows; both are required due to the `windows` crate having poor Result handling with `GetStdHandle`.
|
||||
windows = { version = "0.62.0", features = ["Win32_Security", "Win32_Storage_FileSystem", "Win32_System_Console"] }
|
||||
windows-sys = { version = "0.61.0", features = ["Win32_System_Console"] }
|
||||
|
||||
# Desktop-specific dependencies
|
||||
[target.'cfg(not(target_os = "emscripten"))'.dependencies]
|
||||
# On desktop platforms, build SDL2 with cargo-vcpkg
|
||||
sdl2 = { version = "0.38", default-features = false, features = ["image", "ttf", "gfx", "mixer", "unsafe_textures", "static-link", "use-vcpkg"] }
|
||||
rand = { version = "0.9.2", default-features = false, features = ["thread_rng"] }
|
||||
rust-embed = "8.7.2"
|
||||
spin_sleep = "1.3.3"
|
||||
|
||||
# Browser-specific dependencies
|
||||
[target.'cfg(target_os = "emscripten")'.dependencies]
|
||||
# On Emscripten, we don't use cargo-vcpkg
|
||||
sdl2 = { version = "0.38", default-features = false, features = ["image", "ttf", "gfx", "mixer", "unsafe_textures"] }
|
||||
# TODO: Document why Emscripten cannot use `os_rng`.
|
||||
rand = { version = "0.9.2", default-features = false, features = ["small_rng", "os_rng"] }
|
||||
libc = "0.2.175" # TODO: Describe why this is required.
|
||||
|
||||
[dev-dependencies]
|
||||
pretty_assertions = "1.4.1"
|
||||
speculoos = "0.13.0"
|
||||
|
||||
[build-dependencies]
|
||||
phf = { version = "0.13.1", features = ["macros"] }
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
serde_json = "1.0.143"
|
||||
|
||||
# phf generates runtime code which machete will not detect
|
||||
[package.metadata.cargo-machete]
|
||||
ignored = ["phf"]
|
||||
|
||||
|
||||
[package.metadata.vcpkg]
|
||||
dependencies = ["sdl2", "sdl2-image", "sdl2-ttf", "sdl2-gfx", "sdl2-mixer"]
|
||||
git = "https://github.com/microsoft/vcpkg"
|
||||
rev = "2024.05.24" # to check for a new one, check https://github.com/microsoft/vcpkg/releases
|
||||
|
||||
[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" }
|
||||
aarch64-apple-darwin = { triplet = "arm64-osx" }
|
||||
|
||||
[features]
|
||||
# Windows-specific features
|
||||
force-console = []
|
||||
default = []
|
||||
|
||||
[lints.rust]
|
||||
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(coverage,coverage_nightly)', 'cfg(use_console)'] }
|
||||
BIN
pacman/assets/game/TerminalVector.ttf
Normal file
1061
pacman/assets/game/atlas.json
Normal file
BIN
pacman/assets/game/atlas.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
pacman/assets/game/konami.ttf
Normal file
BIN
pacman/assets/game/sound/begin.ogg
Normal file
BIN
pacman/assets/game/sound/intermission.ogg
Normal file
BIN
pacman/assets/game/sound/pacman/death.ogg
Normal file
BIN
pacman/assets/game/sound/pacman/death.wav
Normal file
BIN
pacman/assets/game/sound/pacman/extra_life.ogg
Normal file
BIN
pacman/assets/game/sound/pacman/fruit.ogg
Normal file
BIN
pacman/assets/game/sound/pacman/ghost.ogg
Normal file
BIN
pacman/assets/game/sound/pacman/waka/1.ogg
Normal file
BIN
pacman/assets/game/sound/pacman/waka/2.ogg
Normal file
BIN
pacman/assets/game/sound/pacman/waka/3.ogg
Normal file
BIN
pacman/assets/game/sound/pacman/waka/4.ogg
Normal file
BIN
pacman/assets/site/favicon.ico
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
96
pacman/assets/site/index.html
Normal file
@@ -0,0 +1,96 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Pac-Man in Rust</title>
|
||||
<link rel="stylesheet" href="build.css" />
|
||||
<style>
|
||||
/* Minimal fallback to prevent white flash and canvas pop-in before CSS loads */
|
||||
html,
|
||||
body {
|
||||
background: #000;
|
||||
color: #facc15;
|
||||
margin: 0;
|
||||
text-align: center;
|
||||
}
|
||||
#canvas {
|
||||
display: block;
|
||||
margin: 1.5rem auto;
|
||||
background: #000;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body class="bg-black text-yellow-400 text-center min-h-screen">
|
||||
<a
|
||||
href="https://github.com/Xevion/Pac-Man"
|
||||
class="absolute top-0 right-0"
|
||||
aria-label="View source on GitHub"
|
||||
>
|
||||
<svg
|
||||
width="80"
|
||||
height="80"
|
||||
viewBox="0 0 250 250"
|
||||
class="fill-yellow-400 [&>.octo-arm,.octo-body]:fill-black"
|
||||
aria-hidden="true"
|
||||
>
|
||||
<path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path>
|
||||
<path
|
||||
d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2"
|
||||
class="octo-arm"
|
||||
></path>
|
||||
<path
|
||||
d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z"
|
||||
class="octo-body"
|
||||
></path>
|
||||
</svg>
|
||||
</a>
|
||||
|
||||
<div class="min-h-screen flex flex-col">
|
||||
<main class="flex-1 flex items-center justify-center px-4">
|
||||
<div class="w-full max-w-5xl">
|
||||
<canvas
|
||||
id="canvas"
|
||||
oncontextmenu="event.preventDefault()"
|
||||
class="block w-full h-full max-h-[90vh] aspect-square"
|
||||
></canvas>
|
||||
|
||||
<div
|
||||
class="mt-8 flex flex-wrap gap-3 justify-center items-center text-sm"
|
||||
>
|
||||
<span class="code">← ↑ → ↓</span>
|
||||
<span class="opacity-70">Move</span>
|
||||
|
||||
<span class="mx-2 opacity-30">|</span>
|
||||
|
||||
<span class="code">Space</span>
|
||||
<span class="opacity-70">Toggle Debug</span>
|
||||
|
||||
<span class="mx-2 opacity-30">|</span>
|
||||
|
||||
<span class="code">P</span>
|
||||
<span class="opacity-70">Pause / Unpause</span>
|
||||
|
||||
<span class="mx-2 opacity-30">|</span>
|
||||
|
||||
<span class="code">M</span>
|
||||
<span class="opacity-70">Mute / Unmute</span>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
const canvas = document.getElementById("canvas");
|
||||
var Module = {
|
||||
canvas: canvas,
|
||||
preRun: [
|
||||
() => {
|
||||
[...canvas.classList]
|
||||
.filter((className) => className.includes("shadow-"))
|
||||
.forEach((className) => canvas.classList.remove(className));
|
||||
},
|
||||
],
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="pacman.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
28
pacman/assets/site/styles.css
Normal file
@@ -0,0 +1,28 @@
|
||||
@import "tailwindcss";
|
||||
|
||||
@font-face {
|
||||
font-family: "TerminalVector";
|
||||
src: url("TerminalVector.ttf");
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
font-display: swap;
|
||||
}
|
||||
|
||||
/* Key badge styling */
|
||||
.code {
|
||||
@apply px-3 py-1 rounded-md font-mono text-[0.9em] lowercase inline-block align-middle;
|
||||
background: rgba(250, 204, 21, 0.08); /* yellow-400 at low opacity */
|
||||
border: 1px solid rgba(250, 204, 21, 0.25);
|
||||
color: #fde68a; /* lighter yellow for readability */
|
||||
font-family: "TerminalVector", ui-monospace, Consolas, "Courier New",
|
||||
monospace;
|
||||
}
|
||||
|
||||
/* Title styling */
|
||||
.arcade-title {
|
||||
font-family: "TerminalVector", ui-monospace, Consolas, "Courier New",
|
||||
monospace;
|
||||
letter-spacing: 0.08em;
|
||||
text-shadow: 0 0 18px rgba(250, 204, 21, 0.15),
|
||||
0 0 2px rgba(255, 255, 255, 0.25);
|
||||
}
|
||||
BIN
pacman/assets/unpacked/cutscene/general_6_10.png
Normal file
|
After Width: | Height: | Size: 120 B |
BIN
pacman/assets/unpacked/cutscene/general_6_11.png
Normal file
|
After Width: | Height: | Size: 120 B |
BIN
pacman/assets/unpacked/cutscene/general_6_12.png
Normal file
|
After Width: | Height: | Size: 116 B |
BIN
pacman/assets/unpacked/cutscene/general_6_9.png
Normal file
|
After Width: | Height: | Size: 115 B |
BIN
pacman/assets/unpacked/cutscene/general_7_10.png
Normal file
|
After Width: | Height: | Size: 192 B |
BIN
pacman/assets/unpacked/cutscene/general_7_11.png
Normal file
|
After Width: | Height: | Size: 187 B |
BIN
pacman/assets/unpacked/cutscene/general_7_8.png
Normal file
|
After Width: | Height: | Size: 196 B |
BIN
pacman/assets/unpacked/cutscene/general_7_9.png
Normal file
|
After Width: | Height: | Size: 215 B |
BIN
pacman/assets/unpacked/cutscene/general_8_10.png
Normal file
|
After Width: | Height: | Size: 107 B |
BIN
pacman/assets/unpacked/cutscene/general_8_11.png
Normal file
|
After Width: | Height: | Size: 189 B |
BIN
pacman/assets/unpacked/cutscene/general_8_8.png
Normal file
|
After Width: | Height: | Size: 115 B |
BIN
pacman/assets/unpacked/cutscene/general_8_9.png
Normal file
|
After Width: | Height: | Size: 195 B |
BIN
pacman/assets/unpacked/cutscene/general_9_10.png
Normal file
|
After Width: | Height: | Size: 177 B |
BIN
pacman/assets/unpacked/cutscene/general_9_11.png
Normal file
|
After Width: | Height: | Size: 177 B |
BIN
pacman/assets/unpacked/cutscene/general_9_8.png
Normal file
|
After Width: | Height: | Size: 125 B |
BIN
pacman/assets/unpacked/cutscene/general_9_9.png
Normal file
|
After Width: | Height: | Size: 122 B |
BIN
pacman/assets/unpacked/edible/apple.png
Normal file
|
After Width: | Height: | Size: 173 B |
BIN
pacman/assets/unpacked/edible/bell.png
Normal file
|
After Width: | Height: | Size: 175 B |
BIN
pacman/assets/unpacked/edible/cherry.png
Normal file
|
After Width: | Height: | Size: 213 B |
BIN
pacman/assets/unpacked/edible/galaxian.png
Normal file
|
After Width: | Height: | Size: 178 B |
BIN
pacman/assets/unpacked/edible/key.png
Normal file
|
After Width: | Height: | Size: 162 B |
BIN
pacman/assets/unpacked/edible/melon.png
Normal file
|
After Width: | Height: | Size: 210 B |
BIN
pacman/assets/unpacked/edible/orange.png
Normal file
|
After Width: | Height: | Size: 177 B |
BIN
pacman/assets/unpacked/edible/strawberry.png
Normal file
|
After Width: | Height: | Size: 195 B |
BIN
pacman/assets/unpacked/effects/100.png
Normal file
|
After Width: | Height: | Size: 136 B |
BIN
pacman/assets/unpacked/effects/1000.png
Normal file
|
After Width: | Height: | Size: 137 B |
BIN
pacman/assets/unpacked/effects/1600.png
Normal file
|
After Width: | Height: | Size: 147 B |
BIN
pacman/assets/unpacked/effects/200.png
Normal file
|
After Width: | Height: | Size: 139 B |
BIN
pacman/assets/unpacked/effects/2000.png
Normal file
|
After Width: | Height: | Size: 148 B |
BIN
pacman/assets/unpacked/effects/300.png
Normal file
|
After Width: | Height: | Size: 149 B |
BIN
pacman/assets/unpacked/effects/3000.png
Normal file
|
After Width: | Height: | Size: 152 B |
BIN
pacman/assets/unpacked/effects/400.png
Normal file
|
After Width: | Height: | Size: 135 B |
BIN
pacman/assets/unpacked/effects/500.png
Normal file
|
After Width: | Height: | Size: 150 B |
BIN
pacman/assets/unpacked/effects/5000.png
Normal file
|
After Width: | Height: | Size: 151 B |
BIN
pacman/assets/unpacked/effects/700.png
Normal file
|
After Width: | Height: | Size: 145 B |
BIN
pacman/assets/unpacked/effects/800.png
Normal file
|
After Width: | Height: | Size: 135 B |
BIN
pacman/assets/unpacked/ghost/blinky/down_a.png
Normal file
|
After Width: | Height: | Size: 181 B |
BIN
pacman/assets/unpacked/ghost/blinky/down_b.png
Normal file
|
After Width: | Height: | Size: 178 B |
BIN
pacman/assets/unpacked/ghost/blinky/left_a.png
Normal file
|
After Width: | Height: | Size: 184 B |
BIN
pacman/assets/unpacked/ghost/blinky/left_b.png
Normal file
|
After Width: | Height: | Size: 181 B |
BIN
pacman/assets/unpacked/ghost/blinky/right_a.png
Normal file
|
After Width: | Height: | Size: 183 B |
BIN
pacman/assets/unpacked/ghost/blinky/right_b.png
Normal file
|
After Width: | Height: | Size: 181 B |
BIN
pacman/assets/unpacked/ghost/blinky/up_a.png
Normal file
|
After Width: | Height: | Size: 177 B |
BIN
pacman/assets/unpacked/ghost/blinky/up_b.png
Normal file
|
After Width: | Height: | Size: 175 B |
BIN
pacman/assets/unpacked/ghost/clyde/down_a.png
Normal file
|
After Width: | Height: | Size: 189 B |
BIN
pacman/assets/unpacked/ghost/clyde/down_b.png
Normal file
|
After Width: | Height: | Size: 187 B |
BIN
pacman/assets/unpacked/ghost/clyde/left_a.png
Normal file
|
After Width: | Height: | Size: 194 B |
BIN
pacman/assets/unpacked/ghost/clyde/left_b.png
Normal file
|
After Width: | Height: | Size: 191 B |
BIN
pacman/assets/unpacked/ghost/clyde/right_a.png
Normal file
|
After Width: | Height: | Size: 194 B |
BIN
pacman/assets/unpacked/ghost/clyde/right_b.png
Normal file
|
After Width: | Height: | Size: 190 B |
BIN
pacman/assets/unpacked/ghost/clyde/up_a.png
Normal file
|
After Width: | Height: | Size: 184 B |
BIN
pacman/assets/unpacked/ghost/clyde/up_b.png
Normal file
|
After Width: | Height: | Size: 179 B |
BIN
pacman/assets/unpacked/ghost/eyes/down.png
Normal file
|
After Width: | Height: | Size: 127 B |
BIN
pacman/assets/unpacked/ghost/eyes/left.png
Normal file
|
After Width: | Height: | Size: 135 B |
BIN
pacman/assets/unpacked/ghost/eyes/right.png
Normal file
|
After Width: | Height: | Size: 134 B |
BIN
pacman/assets/unpacked/ghost/eyes/up.png
Normal file
|
After Width: | Height: | Size: 134 B |
BIN
pacman/assets/unpacked/ghost/frightened/blue_a.png
Normal file
|
After Width: | Height: | Size: 190 B |
BIN
pacman/assets/unpacked/ghost/frightened/blue_b.png
Normal file
|
After Width: | Height: | Size: 186 B |
BIN
pacman/assets/unpacked/ghost/frightened/white_a.png
Normal file
|
After Width: | Height: | Size: 183 B |
BIN
pacman/assets/unpacked/ghost/frightened/white_b.png
Normal file
|
After Width: | Height: | Size: 183 B |
BIN
pacman/assets/unpacked/ghost/inky/down_a.png
Normal file
|
After Width: | Height: | Size: 177 B |
BIN
pacman/assets/unpacked/ghost/inky/down_b.png
Normal file
|
After Width: | Height: | Size: 175 B |
BIN
pacman/assets/unpacked/ghost/inky/left_a.png
Normal file
|
After Width: | Height: | Size: 183 B |
BIN
pacman/assets/unpacked/ghost/inky/left_b.png
Normal file
|
After Width: | Height: | Size: 180 B |
BIN
pacman/assets/unpacked/ghost/inky/right_a.png
Normal file
|
After Width: | Height: | Size: 182 B |
BIN
pacman/assets/unpacked/ghost/inky/right_b.png
Normal file
|
After Width: | Height: | Size: 179 B |
BIN
pacman/assets/unpacked/ghost/inky/up_a.png
Normal file
|
After Width: | Height: | Size: 173 B |
BIN
pacman/assets/unpacked/ghost/inky/up_b.png
Normal file
|
After Width: | Height: | Size: 172 B |
BIN
pacman/assets/unpacked/ghost/pinky/down_a.png
Normal file
|
After Width: | Height: | Size: 182 B |
BIN
pacman/assets/unpacked/ghost/pinky/down_b.png
Normal file
|
After Width: | Height: | Size: 179 B |
BIN
pacman/assets/unpacked/ghost/pinky/left_a.png
Normal file
|
After Width: | Height: | Size: 190 B |
BIN
pacman/assets/unpacked/ghost/pinky/left_b.png
Normal file
|
After Width: | Height: | Size: 187 B |
BIN
pacman/assets/unpacked/ghost/pinky/right_a.png
Normal file
|
After Width: | Height: | Size: 189 B |
BIN
pacman/assets/unpacked/ghost/pinky/right_b.png
Normal file
|
After Width: | Height: | Size: 185 B |
BIN
pacman/assets/unpacked/ghost/pinky/up_a.png
Normal file
|
After Width: | Height: | Size: 179 B |
BIN
pacman/assets/unpacked/ghost/pinky/up_b.png
Normal file
|
After Width: | Height: | Size: 177 B |
BIN
pacman/assets/unpacked/maze/energizer.png
Normal file
|
After Width: | Height: | Size: 2.7 KiB |
BIN
pacman/assets/unpacked/maze/pellet.png
Normal file
|
After Width: | Height: | Size: 2.7 KiB |
BIN
pacman/assets/unpacked/maze/tiles/0.png
Normal file
|
After Width: | Height: | Size: 102 B |
BIN
pacman/assets/unpacked/maze/tiles/1.png
Normal file
|
After Width: | Height: | Size: 79 B |