Home

Awesome

Planetoid

Planetoid

Planetoid is a toy project to demonstrate and learn several technologies. The goal is to create a little multiplayer asteriod game clone.

This project is in an early stage, so many features are missing and need to be implemented. However, as stated initially, the goal is not to propose a real game but a demo to explain and share these technologies.

Targeted infra overview

infra

Project current status

Authors

Game controls

Demo

An online demo can be played here.

Note:

Screenshots

Native application: App native screenshot

Running the wasm application into Firefox: App wasm32 screenshot

Multiplayer game: multiplayer game screenshot

Binaries

Binaries are available here: Binary releases

Run Locally (mainly for development purposes)

  1. Clone the project
  git clone https://github.com/uggla/planetoid
  1. Go to the project directory
  cd planetoid

Worker

  1. Install OpenJDK 11 following the instructions here or install it using your distribution package manager. Ex on Fedora
  dnf install java-11-openjdk-devel
  1. Install maven > 3.6 following the instructions here or install it using your distribution package manager. Ex on Fedora:
  dnf install maven
  1. Go to the worker directory and run the worker in dev mode
cd worker
mvn compile quarkus:dev

Note: Maven will download a lot of dependencies from the internet

Client

Native client

  1. Install Rust following the instructions here.

    Tips: the rustup method is the simplest one.

  2. Install required library for macroquad

apt install pkg-config libx11-dev libxi-dev libgl1-mesa-dev libasound2-dev
dnf install libX11-devel libXi-devel mesa-libGL-devel alsa-lib-devel
No dependencies are required for Windows or MacOS
  1. Go to the client directory and run the native client
cd client
cargo run

Wasm32 client

  1. Follow the above instruction of the native client.

  2. Install basic-http-server

cargo install basic-http-server
  1. Add the wasm32 compilation target
rustup target add wasm32-unknown-unknown
  1. Go to the client directory and run the native client
cd client
cargo build --target wasm32-unknown-unknown
  1. Serve the files and open the browser
basic-http-server
xdg-open http://127.0.0.1:4000
<!-- ## Installation --> <!-- Install my-project with npm --> <!-- ```bash --> <!-- npm install my-project --> <!-- cd my-project --> <!-- ``` -->

Native client usage

Planetoid 0.1.0
Planetoid is an asteroid clone.

USAGE:
    planetoid [FLAGS] [OPTIONS]

FLAGS:
    -d, --debug      Debug mode (_ (error), -d (info), -dd (debug), -ddd (trace))
    -g, --god        God mode
        --help       Prints help information
    -s, --solo       Solo mode, do not connect to network
    -V, --version    Prints version information

OPTIONS:
    -h, --host <host>    Host [default: localhost]
    -m, --mode <mode>    Network mode [default: host]  [possible values: host, guest, spectator]
    -n, --name <name>    Player name [default: planetoid]
    -p, --port <port>    Port [default: 8080]

Examples

Running in solo mode

cargo run -- -s

Running in network mode with a spectator

On the first terminal: cargo run -- -m host -n Planetoid

On the second terminal: cargo run -- -m spectator -n "Planetoid spectator"

Running in network mode, debug and as god

-dd: debug, allows to see messages sent to the web socket.

-g: god mode, player ship cannot be destroyed.

-n: player name (default: planetoid)

cargo run -- -m host -dd -g -n Planetoid

Running in network mode with host and guest

On the first terminal: cargo run -- -m host -n Planetoid

On the second terminal: cargo run -- -m guest -n "Planetoid guest"