2D real-time mutliplayer game in a browser. Showcase of the usability of wasm-peer crate.

Related tags

Games footballers
Overview

Footballers

footballers game

Description

2D real-time multiplayer game in a browser. Players divided in two teams play a football match on field with two goal posts. Goal of the game is for a team to score 3 points before the other team.

This game showcases the usability of wasm-peers crate for easy and costless peer-2-peer WebRTC communication.

Check the hosted game here.

Functionality

Game supports any number of players, but at least 2 are necessary to start the game. Players connect by providing session id received by some means from the game host. This host is responsible for receiving players input, calculating game state and sending updated state to all connected players.

On the field, players can collide with each other and the ball, they can shoot the ball if they are close enough. If one of the teams scores a goal, by bringing the ball across the goal posts, the score is updated and the game is reset.

Local development

To run the game locally you must have Rust and wasm-pack installed. Also, npm is required as well.

Signaling server from wasm-peer project should be running on 0.0.0.0:9001. See here for instructions.

First, some env variables are required:

# for now, only env variable without the default is the signaling server address
# in production, it should be some publicly available server, for ex. EC2 instance (tiny one should suffice)
export SIGNALING_SERVER_URL="ws://0.0.0.0:9001"

Then you can build the project:

wasm-pack build
cd webpage
npm run build # npm run start, if you want hot-reloading and serving

This will create a webpage/dist folder with index.html and all the other required files. You can serve them any way you like.

Authors

Arkadiusz Górecki
LinkedIn

Tomasz Karwowski
LinkedIn

License

This project is licensed under either of

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

You might also like...
This is a simple implementation of the classic snake game in rust
This is a simple implementation of the classic snake game in rust

My snake game Looks like this. This is with Roboto Mono Nerd Font. If you use a different font it may look different or distorted. Install rust In ord

The classic tetris game written in Rust using ncurses
The classic tetris game written in Rust using ncurses

tetris.rs This is the classic tetris game I wrote to have a bit of fun with Rust. Installation and playing cargo install --

A refreshingly simple data-driven game engine built in Rust

What is Bevy? Bevy is a refreshingly simple data-driven game engine built in Rust. It is free and open-source forever! WARNING Bevy is still in the ve

Data-oriented and data-driven game engine written in Rust
Data-oriented and data-driven game engine written in Rust

What is Amethyst? Amethyst is a data-driven and data-oriented game engine aiming to be fast and as configurable as possible. Principles These principl

Rust library to create a Good Game Easily

ggez What is this? ggez is a Rust library to create a Good Game Easily. The current version is 0.6.0-rc0. This is a RELEASE CANDIDATE version, which m

Rate my game setup 😜
Rate my game setup 😜

minesweeper.rs Rate my game setup 😜

Snake Game in rust for the web

About This template shows how to create a web app using Yew and wasm-pack. 🚴 Usage 🛠️ Build When building for the first time, ensure to install depe

Minesweeper game where you only lose if the move is certainly wrong.
Minesweeper game where you only lose if the move is certainly wrong.

Non-deterministic Minesweeper Tired of having to guess in a game of minesweeper? Worry no more! This is a variation of Minesweeper game where you only

Octo3D - A 3D Game Engine for the Web!
Octo3D - A 3D Game Engine for the Web!

Octo3D is a WebGPU based 3D Game Development Engine for the web. It provides various functions and utilities to improve the game development experience on the web while leveraging technologies such as TypeScript and WASM (via Rust!).

Owner
null
Minesweeper game developed with Rust, WebAssembly (Wasm), and Canvas

?? click here to play the game ?? Minesweeper game Revealing all the cells without hitting the mines is the task. Each number in the cell denotes how

Karthik Nedunchezhiyan 23 Dec 28, 2022
The video game for Fonts of Power. A tabletop roleplaying game made in Rust with Bevy!

The code and rules for Fonts of Power, a tactical TTRPG / video game about exploring magical places. You can follow its development in our Discord ser

null 25 Dec 23, 2022
Red Light, Green Light is a traditional Korean children's game, popularised by the Squid Game TV series.

Red Light, Green Light Red Light, Green Light is a traditional Korean children's game, popularised by the Squid Game TV series. This project is the di

Cedric Chee 1 Jan 10, 2022
A game inspired by the classic atari game: demon attack

rusty_demon_attack A game inspired by the classic atari game: demon attack You can play the game in the web!

null 58 Jan 4, 2023
A collection of small games for the Fantasy Console WASM-4

WASM-4 Tutorial Games This repo contains the source code for different tutorial games for the Fantasy Console WASM-4. The goal is to provide a one-sto

Chris 15 Aug 10, 2022
A work-in-progress, open-source, multi-player city simulation game.

Citybound is a city building game with a focus on realism, collaborative planning and simulation of microscopic details. It is independently developed

Citybound 7.2k Jan 3, 2023
A roguelike game in Rust

A fantasy deathcrawl in Rust Work in progress. To run, with Rust compiler and Cargo package manager installed: cargo run --release When building on W

Risto Saarelma 347 Nov 21, 2022
Extensible open world rogue like game with pixel art. Players can explore the wilderness and ruins.

Rusted Ruins Extensible open world rogue like game with pixel art. Players can explore the wilderness and ruins. This game is written in Rust. Screens

T. Okubo 427 Dec 13, 2022
😠⚔️😈 A minimalistic 2D turn-based tactical game in Rust

Zemeroth is a turn-based hexagonal tactical game written in Rust. Support: patreon.com/ozkriff News: @ozkriff on twitter | ozkriff.games | facebook |

Andrey Lesnikóv 1.3k Jan 5, 2023
⬡ Zone of Control is a hexagonal turn-based strategy game written in Rust. [DISCONTINUED]

Zone of Control The project is discontinued Sorry, friends. ZoC is discontinued. See https://ozkriff.github.io/2017-08-17--devlog.html Downloads Preco

Andrey Lesnikóv 354 Nov 14, 2022