Giter Club home page Giter Club logo

jstroopers's Introduction

JS Troopers

JS Troopers is a Nodejs implementation of a player (bot) for Lugo game.

This bot was made using the Node Client Player.

Use this bot as a starting point to a new one.

Dependencies

Before starting

Are you familiar with Lugo? If not, before continuing, please visit the project website and read about the game.

How to use this source code

  1. Checkout the code or download the most recent tag release

  2. Install the dependencies and compile the Typescript: keep the watcher service ALWAYS running to keep your code ready to be run. When this service is not running, ‼️ your code changes will NOT be executed ‼️

    docker-compose -f watcher-compose.yml up
  3. Test it out: Before any change, make the JS Troopers play to ensure you are not working on a broken code.

    docker-compose up

    and open http://localhost:8080/ to watch the game.

  4. Now, make your changes: change the methods in current bot. You may also need to change some settings in the main file

  5. Play again to see your changes results:

    docker-compose up
  6. Are you ready to compete? Build your Docker image:

    docker build -t my-super-bot .
  7. Before pushing your changes

    MY_BOT=my-super-bot docker-compose --file docker-compose-test.yml up

Running directly in your machine

If you want to run the NodeJS code in your machine instead of inside the container, you definitely can do this.

The command to start locally is BOT_NUMBER=1 BOT_TEAM=home npm run start. However, when you run the Docker compose file, all players from both teams will start. Then, if you run another bot directly from your machine, it will not be allowed to join the game.

But you also cannot start your bot before the game server has started.

You have two options to run your bot locally.

Option 1 - comment out the bot from the Docker compose file

You can edit the file docker-compose.yml and comment out the player that you want to run locally.

The game server will wait all 11 players from both teams to connect before starting the game.

Option 2 - starting the game server first

You can start only the game server with the command game_server. The game will wait for the players. Then, you start your local bot (BOT_NUMBER=1 BOT_TEAM=home npm run start), and finally start the rest of the players with the command docker-compose up

jstroopers's People

Contributors

tarishenrique 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.