Giter Site home page Giter Site logo

arustoid's Introduction

aRustOid

a WebAssembly game written in Rust with a backend webserver using websockets to handle multiple players.

A simple game to blow up as many rocks as possible, hopefully beating player 2. To run multiplayer player 1 kicks off the game, then player 2 needs to select the correct game number from the list

Use left,right,up arrow keys and space to fire

to try live go to https://bjason.org/game

to build and run locally

# get rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
# uses SDL2 as well as opengl
sudo apt install libsdl2-dev

# you need emscripten to handle compilation to WebAssembly
git clone https://github.com/emscripten-core/emsdk.git
cd emsdk
./emsdk install 1.39.20
./emsdk activate 1.39.20
# either update your profile or source in emsdk_env.sh as advised by emsdk
source emsdk_env.sh

# add web target for rust
rustup target add wasm32-unknown-emscripten 

# Rocket needs nightly build
rustup toolchain install nightly
rustup default nightly

# first build the application
cargo build --target=wasm31-unknown-emscripten && cp target/wasm32-unknown-emscripten/debug/arustoid* pkg/

# You can run locally within SDL2 
cargo run

# now build the webserver
cd rust_socket_arustoid
cargo build 
cargo run

go to http://127.0.0.1:8000

arustoid's People

Contributors

bernardjason avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.