Skip to content

2048 Game

Mr5ecret edited this page Jan 14, 2024 · 3 revisions
PΛΞ0NIC Development Banner

🔢 2048 Game

Simple 2048 game with buttons

/2048

Edited: Version 4.2.3


const { TwoZeroFourEight } = require('flex-gamecord');

const Game = new TwoZeroFourEight({
  message: message,
  isSlashGame: false,
  embed: {
    title: '2048',
    color: '#5865F2',
    fields: [
      {
        name: 'Current Score',
        value: '{score}',
        inline: true,
      },
      {
        name: 'Player',
        value: '{player}', // Options: {player.tag} {player} {player.displayName}
        inline: true,
      }
    ],
    footerEnabled: false,
    footer: {
      text: `PΛΞ0NIC Development`,
      // iconURL: 'someIconURL', // If you want to add iconURL then remove the comment and add working url!
    },
    timestamp: false,
  },
  emojis: {
    up: '⬆️',
    down: '⬇️',
    left: '⬅️',
    right: '➡️',
  },
  timeoutTime: 60000,
  buttonStyle: 'PRIMARY',
  playerOnlyMessage: 'Only {player} can use these buttons.'
});

Game.startGame();
Game.on('gameOver', result => {
  console.log(result);  // =>  { result... }
});

📝 / Slash Commands

message: interaction,
isSlashGame: true,

🆕 Updates

*** v4.2.3
+ Added footer/timeStamp option
+ Added option to disable footer
+ Added fields option
+ Removed API fetch and made game local using canvas