A multiplayer game based on tetris made with Svelte, PixiJS and Colyseus
Explore the docs »
View Demo
·
Report Bug
·
Welcome to the tetrarena repo. This project aims to bring the classic Tetris experience to both single-player and competitive multiplayer modes. Here’s an overview of what this project offers:
This game recreates the classic Tetris experience, but with exciting new features to cater to both solo players and competitive enthusiasts:
Single-Player Mode: Enjoy the traditional Tetris gameplay on your own. Perfect for practicing your skills or playing at your own pace.
Multiplayer Ranked Matches: Queue up for a ranked game and compete against other players. Your rank will increase or decrease based on your performance in matches, adding a competitive edge to your Tetris experience.
Custom Rooms: Create your own game room with customizable options. Invite friends or other players to join and enjoy a personalized Tetris match with your preferred settings.
When you first enter the game, you'll be logged in as a guest, allowing you to jump straight into the action. However, you can also create an account using your email to unlock additional features:
This project is structured as a monorepo, meaning both the client and server codebases are housed within a single repository. This setup facilitates easier management of dependencies, shared code, and versioning, ensuring consistency across the entire project.
The tools used are:
For the different workspaces, there are two apps:
And two packages:
This repo also uses husky to lint commit messages, they must conform to conventional commits specification.
This is an example of how you may give instructions on setting up your project locally. To get a local copy up and running follow these simple example steps.
This project uses pnpm as the package manager
npm install -g pnpm
Below is an example of how you can instruct your audience on installing and setting up your app. This template doesn't rely on any external dependencies or services.
git clone https://github.com/jmischler72/tetrarena.git
pnpm install
pnpm turbo run build --filter @jmischler72/shared --filter @jmischler72/core
To enable authentication and real-time data storage, you'll need to set up a Firebase project and configure both the Firebase SDK for your client application and the Firebase Admin SDK for your server.
Once you have created the project you need to activate Firebase Authentication with these connections methods:
You will also need to activate Realtime Database and enter the rules that you can find in the file firebase.rules
in the root of the repo
You then need to go to the project settings and create a web application, then copy the firebaseConfig
and replace the config from apps/client/src/lib/data/config/firebase.config.ts
It should look like that with your credentials:
export const firebaseConfig = {
apiKey: "",
authDomain: "",
databaseURL: "",
projectId: "",
storageBucket: "",
messagingSenderId: "",
appId: "",
measurementId: ""
};
You need to go to the firebase console, in the settings go to Service Accounts, click generate new private key.
Then copy the file .env.example
from apps/server
to .env
and copy from the file you just downloaded the variable needed in the environment file, you will also need DATABASE_URL
shown in firebase console
When you have correctly configured Firebase, you can then run a dev server with:
pnpm turbo run dev
If you have a suggestion that would make this better, you can simply open an issue. Don't forget to give the project a star! Thanks!
Distributed under the GPL-3.0 License. See LICENSE.txt
for more information.
Joffrey Mischler - jmischler72 - joffrey.mischlerps@gmail.com
Project Link: https://github.com/jmischler72/tetrarena
This project/technical aspects of this repo were inspired by: