Giter Site home page Giter Site logo

discord-2048's Introduction

Discord-2048

A discord bot made in python for the game 2048 for Discord's Hack Week 2019.

To test the bot, please join https://discord.gg/C7mgt52

Game info: 2048 is a game in which you must slide around tiles labeled with powers of 2 in four directions. When two tiles of the same value combine, they get added together, creating a new tile with double the value. After each successful move, a random tile either 2 or 4 is generated. The goal, as one might guess, is to reach a tile with a value of 2048. If at any point the user is unable to slide any tiles (the board is full and there are no adjacent combinations to be made) the game is over.

An online version (not made by me) can be found here: https://2048.app/

Bot info: Python 3.6 or higher

Add a bot token in bot_config.json and choose either true or false for "smoother" which will determine if an await is added as a delay before adding in the random tile after each successful move (which, if true, makes it appear a bit smoother). Sometimes though, when it is true, your discord client may not see the new tile right away and you may need to switch channels to see it. On the test server, it is false to prevent this, but it does look a lot better with the small delay.

To use, type '!start' in a channel the bot has access to and it will start a game for you. You can control the direction you move by using the arrow reactions below the message. React a :regional_indicator_x: to end the game and remove the game board prematurely (only accessible by the user that started the game). Once the game ends in a win or loss, anyone can react a :regional_indicator_x: to remove the game board.

The encrypted text in the embed footer is game information like who originally requested the game and the actual state of the game. This is to prevent having to store each game's state in the bot program.

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.