Skip to content

peturparkur/multiplayer-flappybird

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Multiplayer Flappy-Bird

Websocket server using rust actix framework.

The code was adapted from a simple chat/messaging room/lobby server.

Game

The game code is contained within the game folder.

Server/Network

We have two layers for the websocket communication.

This contains the front-facing object that receives the messages from the front-end (or bots) and converts them into a more directed message to the room-server

This contains the meat of the code. It handles the messages received from the front-facing client, and send messages back to it.

The way the games are being created is a client can connect to the an endpoint such as ws://localhost:8080/{room_id}. If the room_id doesn't exist yet it will be created (NOTE: this should be changed for production as we don't want clients to spam create new lobbies).

Once within the lobby a game instance is created for the lobby and the user can either just spectate (not sending input), or create a character and ready up (send !ready after an input was sent). Currently input is a simple boolean true/false which will set the jump-state of the bird to the given value

Commands

Running the server

A quick server instance can be started via cargo.

cargo run --release

About

Multiplayer Flappy-Bird via Websocket

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published