Giter Club home page Giter Club logo

pong-online's Introduction

Pong online

Pong multiplayer on the terminal using an made with node js. The API is here.

libraries to install

  • For terminal handling.

    pip install curses / pip install windows-curses

  • For the API.

    pip install socketio

  • To listen to the movement keys.

    pip install pytimedinput

    For this library I make some changes so that it does not print the value of the keys when they are pressed. The changes I made are here: pytimedinput .

    • The file you have to change is located in "C:\Users\ username\AppData\Local\Programs\Python\Python311\Lib\site-packages\pytimedinput", all you have to do is replace it with the file called pytimedinput.py with the file that is here.

How to use

The first thing to do is to download the Python files of the host and the guest, the first one manages the game and the other one only receives it.

  1. First we run the pong-guest.py file and enter the URL where we have the api server or service mounted and the name of the "party" (it's the name of the json object that is stored with the game information in the API).

  2. Then we execute the pong-host.py file and do the same procedure of the URL and the party name, this will start the game, which will end when the score of one of the two players reaches 10.

  3. Finally, to play, player 1 (host) moves with the "w d" keys up and down respectively, player 2 (guest) with the "k m" keys in the same way.

  4. to exit the game use the "q" key.

It should be noted that the execution of the files must be done inside the console or terminal since the curses library works by superimposing another terminal or console on top of ours.

pong-online's People

Contributors

lipezj avatar

Watchers

 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.