Giter VIP home page Giter VIP logo

tengen-tetris's Introduction

tengen-tetris

Tengen Tetris web app using Python Flask at the backend and p5.js at the frontend

Introduction

This project runs as a Flask server that users can interact with through their browser, by knowing the IP of the machine that is serving it, and the port, which by default is 8080 (there is currently no easy way to modify this). It is displayed on the client side using the p5.js library.

It tries to mimic the NES Tetris experience in terms of fall speed and score assignments. The display of elements in the canvas is also similar to NES Tetris. The duo game mode mechanics have been completely inspired by Tengen Tetris. Finally, the aesthetic has been moved to a more retro-cyberpunk vibe, as if you were playing on some old green phosphorous screen while the world is falling apart due to the cyborg awakening.

There is a scoreboard to which players can upload their high scores and compete.

Screenshot of duo mode

Game modes

There are two game modes:

  • Solo: select a level and start playing. You will be on your own. You can pause and quit. You will be able to submit your high score to the server once you die.
  • Duo: click on Look for another player and once another user does the same on their client, you will both start a duo game. Select level at the beginning (ech of you can select its own level) and play. You will be able to see your oponent's screen on the right of yours to track their movements. The same pieces will fall for both of you, even if you die and decide to try again.

How to run it on your machine

Instructions can only be provided for a Linux box, sorry. Also, specific instructions are given for an Ubuntu Server, although you will be able to figure out how to install it on any other Linux box.

  1. cd to a new directory
  2. Clone this repo with git clone
  3. This runs on Python 3, so be sure to have that installed
  4. Be sure to have pip3 package for Python 3 dependencies installation, on Ubuntu this can be installed by running apt install python3-pip. With it, run pip3 on requirements package file named requirements.txt:
  • pip3 install -r requirements.txt
  1. Run the server with python3 application.py or run it on the background with nohup python3 application.py > out.log &
  2. Open a web browser and connect to localhost:8080. If you can see a page, everything has worked fine.
  3. Find out the IP address of your box by running ip a, and, from another computer within the same network, connect to <ip>:8080.

How to run it with docker

1.- build docker image

docker build -t tengen-tetris .

2.- run docker image

docker run -p 8080:8080 tengen-tetris

app will run on localhost:8080

How to run it on kubernetes via helm chart

  • install helm chart
helm install  my-release-1 kubernetes/helm/ --values kubernetes/helm/values.yaml  --namespace  default

using make

make helm-install RELEASE=tengen-tetris-release-1 NAMESPACE=default
  • upgrade helm chart
helm upgrade my-release-1 kubernetes/helm/ --values kubernetes/helm/values.yaml  --namespace  default

using make

make helm-upgrade RELEASE=tengen-tetris-release-n NAMESPACE=default
  • uninstall helm chart
helm uninstall  my-release-n  --namespace  default

using make

make helm-uninstall RELEASE=tengen-tetris-release-n NAMESPACE=default

In the 'docs' folder, you will find comprehensive documentation outlining the technical decisions made for deploying our web application on Kubernetes.

tengen-tetris's People

Contributors

aitorperezzz avatar crimsonnx avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.