A game written in Rust, compilable to webbassembly

Overview

Dig Escape

Dig Escape is a simple puzzle game written in Rust

The game is playable here: https://tantandev.itch.io/digescape

Background

What started out as a small project with the goal of learning Rust , ended up being released playable on the web!

The progress was recorded on my Youtube Channel

Building

before you can run using cargo, The game assets need to be zipped as a .tar and put into the src/ folder

To automatically zip the /resources there is a script in utils/wasm/zip_resources.sh you can run using git bash:

# first cd into the utils/wasm/ folder
./zip_resources.sh

Then we can use cargo to run the project on windows

cargo run

WebAssembly

There is a script in utils/wasm/build.sh you can run using git bash.

./build.sh

This script compiles the program with cargo, takes the generated dig_escape.wasm file, and the files in utils/wasm/ and moves them into a new folder called static/. To run it in the browser I'm, using basic-http-server.

cargo install basic-http-server

start the server by using the correct path

basic-http-server . # starts server based on current directory
basic-http-server static # start server in the folder /static

External assets with license

in this project I'm using Kenny assets fonts which is using: License: (Creative Commons Zero, CC0)

Dependencies

Forked Game framework Good-web-game Note: I'm using the audio branch which is a work in progress

You might also like...
A Client/Server game networking plugin using QUIC, for the Bevy game engine.
A Client/Server game networking plugin using QUIC, for the Bevy game engine.

Bevy Quinnet A Client/Server game networking plugin using QUIC, for the Bevy game engine. Bevy Quinnet QUIC as a game networking protocol Features Roa

Managed game servers, matchmaking, and DDoS mitigation that lets you focus on building your game
Managed game servers, matchmaking, and DDoS mitigation that lets you focus on building your game

Managed game servers, matchmaking, and DDoS mitigation that lets you focus on building your game. Home - Docs - Twitter - Discord 👾 Features Everythi

A no-frills Tetris implementation written in Rust with the Piston game engine, and Rodio for music.
A no-frills Tetris implementation written in Rust with the Piston game engine, and Rodio for music.

rustris A no-frills Tetris implementation written in Rust with the Piston game engine, and Rodio for music. (C) 2020 Ben Cantrick. This code is distri

rpg-cli is a bare-bones JRPG-inspired terminal game written in Rust
rpg-cli is a bare-bones JRPG-inspired terminal game written in Rust

rpg-cli is a bare-bones JRPG-inspired terminal game written in Rust. It can work as an alternative to cd where you randomly encounter enemies as you change directories.

A interactive and fun to use memory game written in Rust

memg - Memory Game memg is a interactive and fun to use memory game written in rust Installation Make sure you have rust installed. Use this official

A feature-rich, production-ready, general purpose 2D/3D game engine written in Rust with a scene editor.
A feature-rich, production-ready, general purpose 2D/3D game engine written in Rust with a scene editor.

A feature-rich, production-ready, general purpose 2D/3D game engine written in Rust with a scene editor.

Dwarf Fortress inspired frontend to Veloren, the multiplayer RPG voxel game written in Rust
Dwarf Fortress inspired frontend to Veloren, the multiplayer RPG voxel game written in Rust

velobracket ('veloren' + 'bracket-lib') velobracket is Dwarf Fortress inspired frontend to Veloren, the multiplayer RPG voxel game written in Rust. Us

Game of life implementation written in Rust.

Game of life Game of life implementation written in Rust. Part of my journey in learning Rust. Pattern files The patterns are based on the example pat

Small game where you play a big spider chasing small spiders, written in Rust and Macroquad.
Small game where you play a big spider chasing small spiders, written in Rust and Macroquad.

Ludum Dare #49 Compo entry - Procedural Spider Small game where you play a big spider chasing small spiders. Each spider you catch makes you bigger! C

Comments
  • Doesn't compile on Ubuntu 18.04 - src/audio.rs:4:5 no 'decoder' in the root

    Doesn't compile on Ubuntu 18.04 - src/audio.rs:4:5 no 'decoder' in the root

    I tried to compile it to run it locally on my Ubuntu 18.04. This errors out on the gwg audio part. Do I miss some dev-packages? Or is this releated to the rust version?

    $ rustc --version
    rustc 1.62.1 (e092d0b6b 2022-07-16)
    $ git clone https://github.com/TanTanDev/DigEscape.git
    $ cd DigEscape/
    $ cargo c
        Updating git repository `https://github.com/TanTanDev/good-web-game`
        Updating crates.io index
        Updating git repository `https://github.com/not-fl3/miniquad_text_rusttype`
        Updating git repository `https://github.com/not-fl3/quad-snd`
        Checking nodrop v0.1.14
        Checking ttf-parser v0.6.2
        Checking libc v0.2.126
        Checking num-traits v0.1.43
        Checking arrayvec v0.4.12
        Checking euclid v0.18.2
        Checking sid v0.5.2
        Checking getrandom v0.1.16
        Checking rand_os v0.1.3
        Checking sapp-linux v0.1.7
        Checking filetime v0.2.17
        Checking quad-alsa-sys v0.3.2
        Checking lyon_geom v0.11.1
        Checking rand v0.6.5
        Checking rand_core v0.5.1
        Checking tar v0.4.38
        Checking owned_ttf_parser v0.6.0
        Checking quad-snd v0.2.3 (https://github.com/not-fl3/quad-snd#ccdbe8be)
        Checking rand_chacha v0.2.2
        Checking lyon_path v0.11.0
        Checking rusttype v0.9.2
        Checking cgmath v0.17.0
        Checking rand v0.7.3
        Checking miniquad v0.2.55
        Checking lyon_algorithms v0.11.2
        Checking lyon_tessellation v0.11.0
        Checking miniquad_text_rusttype v0.1.2 (https://github.com/not-fl3/miniquad_text_rusttype#bd4477a3)
        Checking lyon v0.11.0
        Checking rand_distr v0.2.2
        Checking nalgebra v0.20.0
        Checking good-web-game v0.2.5 (https://github.com/TanTanDev/good-web-game?branch=audio#2685d96e)
    error[E0432]: unresolved imports `quad_snd::decoder`, `quad_snd::mixer::Sound`, `quad_snd::mixer::SoundMixer`
     --> /home/jarop/.cargo/git/checkouts/good-web-game-af1e58d1707853cb/2685d96/src/audio.rs:4:5
      |
    4 |     decoder,
      |     ^^^^^^^ no `decoder` in the root
    5 |     mixer::{Sound, SoundMixer},
      |             ^^^^^  ^^^^^^^^^^ no `SoundMixer` in `mixer`
      |             |
      |             no `Sound` in `mixer`
    
    error[E0603]: module `mixer` is private
      --> /home/jarop/.cargo/git/checkouts/good-web-game-af1e58d1707853cb/2685d96/src/audio.rs:5:5
       |
    5  |     mixer::{Sound, SoundMixer},
       |     ^^^^^ private module
       |
    note: the module `mixer` is defined here
      --> /home/jarop/.cargo/git/checkouts/quad-snd-acc920ee6996f98e/ccdbe8b/src/lib.rs:30:1
       |
    30 | mod mixer;
       | ^^^^^^^^^^
    
    error[E0282]: type annotations needed
      --> /home/jarop/.cargo/git/checkouts/good-web-game-af1e58d1707853cb/2685d96/src/audio.rs:18:41
       |
    18 |             mixer: Rc::new(RefCell::new(None)),
       |                                         ^^^^ cannot infer type for type parameter `T` declared on the enum `Option`
    
    Some errors have detailed explanations: E0282, E0432, E0603.
    For more information about an error, try `rustc --explain E0282`.
    error: could not compile `good-web-game` due to 3 previous errors
    
    opened by PJaros 1
Owner
null
A game of snake written in Rust using the Bevy game engine, targeting WebGL2

Snake using the Bevy Game Engine Prerequisites cargo install cargo-make Build and serve WASM version Set your local ip address in Makefile.toml (loca

Michael Dorst 0 Dec 26, 2021
Victorem - easy UDP game server and client framework for creating simple 2D and 3D online game prototype in Rust.

Victorem Easy UDP game server and client framework for creating simple 2D and 3D online game prototype in Rust. Example Cargo.toml [dependencies] vict

Victor Winbringer 27 Jan 7, 2023
2-player game made with Rust and "ggez" engine, based on "Conway's Game of Life"

fight-for-your-life A 2-player game based on the "Conway's Game of Life", made with Rust and the game engine "ggez". Create shapes on the grid that wi

Petros 3 Oct 25, 2021
A tetris game I wrote in rust using ncurses. I'm sure that there's a better way to write a tetris game, and the code may be sus, but it techinically works

rustetris A tetris game I wrote in rust using ncurses. I'm sure that there's a better way to write a tetris game, and the code may be sus, but it tech

Eric G 3 Oct 15, 2022
Wasm game of life - A Rust and WebAssembly tutorial implementing the Game of Life

wasm_game_of_life Conway's Game of Life in Rust and WebAssembly Contributing | Chat Built with ?? ?? by The Rust and WebAssembly Working Group About T

Rust and WebAssembly 236 Dec 24, 2022
Conway's Game of Life implemented for Game Boy Advance in Rust

game-of-life An implementation of a Conway's Game of Life environment on GBA. The ultimate game should have two modes: Edit and Run mode which can be

Shane Snover 1 Feb 16, 2022
2d Endless Runner Game made with Bevy Game Engine

Cute-runner A 2d Endless Runner Game made with Bevy Game Engine. Table of contents Project Infos Usage Screenshots Disclaimer Project Infos Date: Sept

JoaoMarinho 2 Jul 15, 2022
A game for the game jam "1-Button Jam 2021"

One click ninja A game for the game jam "1-Button Jam 2021" written in Rust with the Bevy engine. A rhythm game, where you play a soldier that can def

Alex Helfet 7 Apr 12, 2022
My first attempt at game programming. This is a simple target shooting game built in macroquad.

sergio My first attempt at game programming. This is a simple target shooting game built in macroquad. Rules Hit a target to increase score by 1 Score

Laz 1 Jan 11, 2022
A game made in one week for the Bevy engine's first game jam

¿Quien es el MechaBurro? An entry for the first Bevy game jam following the theme of "Unfair Advantage." It was made in one week using the wonderful B

mike 20 Dec 23, 2022