Footballers
2D real-time mutliplayer game in a browser. Example usage of wasm-peers library.
Install / Use
/learn @wasm-peers/FootballersREADME
Footballers
<img style="display: block; margin-left: auto; margin-right: auto" src="https://i.imgur.com/111ChMK.png" alt="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 trunk installed.
Signaling server from wasm-peer project should be running on 0.0.0.0:9001.
See here for instructions.
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).
You can run the project:
SIGNALING_SERVER_URL="ws://0.0.0.0:9001" trunk serve # comes with awesome hot-reloading
If you only want to build the static files:
SIGNALING_SERVER_URL="ws://0.0.0.0:9001" trunk build
This will create a dist folder with index.html and all the other required files.
You can serve them any way you like.
Roadmap
- [ ] Allow game restart after it ends
- [ ] Remove disconnected players from the game
- [x] Move JavaScript code to Rust
Authors
Arkadiusz Górecki
LinkedIn
Tomasz Karwowski
LinkedIn
License
This project is licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
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.
Related Skills
himalaya
341.6kCLI to manage emails via IMAP/SMTP. Use `himalaya` to list, read, write, reply, forward, search, and organize emails from the terminal. Supports multiple accounts and message composition with MML (MIME Meta Language).
node-connect
341.6kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
84.6kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
coding-agent
341.6kDelegate coding tasks to Codex, Claude Code, or Pi agents via background process
