mirror of
https://github.com/Xevion/Pac-Man.git
synced 2025-12-06 17:15:47 -06:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b3a3664578 | |||
| 2b667bb6a2 | |||
| 9a88e71202 |
28
.github/workflows/deploy.yaml
vendored
Normal file
28
.github/workflows/deploy.yaml
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
name: Github Pages
|
||||
|
||||
on: [push]
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
build-github-pages:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2 # repo checkout
|
||||
- uses: mymindstorm/setup-emsdk@v11 # setup emscripten toolchain
|
||||
# with:
|
||||
# version: 3.1.35
|
||||
- uses: actions-rs/toolchain@v1 # get rust toolchain for wasm
|
||||
with:
|
||||
toolchain: stable
|
||||
target: wasm32-unknown-emscripten
|
||||
override: true
|
||||
- name: Rust Cache # cache the rust build artefacts
|
||||
uses: Swatinem/rust-cache@v1
|
||||
- name: Build # build
|
||||
run: ./build.sh
|
||||
- name: Deploy
|
||||
uses: JamesIves/github-pages-deploy-action@v4
|
||||
with:
|
||||
folder: dist
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1 +1,2 @@
|
||||
/target
|
||||
.idea
|
||||
10
build.sh
Executable file
10
build.sh
Executable file
@@ -0,0 +1,10 @@
|
||||
#!/bin/sh
|
||||
set -eux
|
||||
|
||||
cargo build --target=wasm32-unknown-emscripten --release
|
||||
|
||||
mkdir -p dist
|
||||
|
||||
cp target/wasm32-unknown-emscripten/release/rust_sdl2_wasm.wasm dist
|
||||
cp target/wasm32-unknown-emscripten/release/rust-sdl2-wasm.js dist
|
||||
cp index.html dist
|
||||
0
src/board.rs
Normal file
0
src/board.rs
Normal file
44
src/constants.rs
Normal file
44
src/constants.rs
Normal file
@@ -0,0 +1,44 @@
|
||||
pub const BOARD_WIDTH: u32 = 28;
|
||||
pub const BOARD_HEIGHT: u32 = 36;
|
||||
pub const BLOCK_SIZE_24: u32 = 24;
|
||||
pub const BLOCK_SIZE_32: u32 = 32;
|
||||
|
||||
pub const WINDOW_WIDTH: u32 = BLOCK_SIZE_24 * BOARD_WIDTH;
|
||||
pub const WINDOW_HEIGHT: u32 = BLOCK_SIZE_24 * BOARD_HEIGHT;
|
||||
|
||||
pub const RAW_BOARD: &str = r###"
|
||||
|
||||
|
||||
############################
|
||||
#............##............#
|
||||
#.####.#####.##.#####.####.#
|
||||
#o####.#####.##.#####.####o#
|
||||
#.####.#####.##.#####.####.#
|
||||
#..........................#
|
||||
#.####.##.########.##.####.#
|
||||
#.####.##.########.##.####.#
|
||||
#......##....##....##......#
|
||||
######.##### ## #####.######
|
||||
#.##### ## #####.#
|
||||
#.## 1 ##.#
|
||||
#.## ###==### ##.#
|
||||
######.## # # ##.######
|
||||
. #2 3 4 # .
|
||||
######.## # # ##.######
|
||||
#.## ######## ##.#
|
||||
#.## ##.#
|
||||
#.## ######## ##.#
|
||||
######.## ######## ##.######
|
||||
#............##............#
|
||||
#.####.#####.##.#####.####.#
|
||||
#.####.#####.##.#####.####.#
|
||||
#o..##.......0 .......##..o#
|
||||
###.##.##.########.##.##.###
|
||||
###.##.##.########.##.##.###
|
||||
#......##....##....##......#
|
||||
#.##########.##.##########.#
|
||||
#.##########.##.##########.#
|
||||
#..........................#
|
||||
############################
|
||||
|
||||
"###;
|
||||
11
src/game.rs
Normal file
11
src/game.rs
Normal file
@@ -0,0 +1,11 @@
|
||||
pub struct Game {}
|
||||
|
||||
impl Game {
|
||||
pub fn new() -> Game {
|
||||
Game {}
|
||||
}
|
||||
|
||||
pub fn tick() {}
|
||||
|
||||
pub fn draw() {}
|
||||
}
|
||||
Reference in New Issue
Block a user