Build a game
Last updated
Was this helpful?
Last updated
Was this helpful?
To make a new game with 2bttns, go to the Games area in your Console. After you name your new game, open it to set it up.
You can also create games directly from the API using the following endpoint:
Set the length of your game.
Set a question prompt for users to answer.
Input data into your game buttons.
Once you've created your game, you can configure the following settings:
ID
A default ID is generated for you when a Game is created.
An ID may only contain alphanumeric, underscore (_), and hyphen (-) characters.
⚠️ Warning: Changing the ID will change the URL of the Game. This may break external connections to your Game.
Name
Optional display name of the Game
Description
Optional text description of the Game.
Input Tags
Choose the tag(s) corresponding to the collection of Game Objects that players should see when they play the Game.
Number of Game Objects
The number of Game Objects associated with this game, based on the Input Tags associated with this Game.
Custom CSS
Custom CSS stylesheet for overriding the Game UI elements. Different modes will expose different classes you can use to override their styles.
Behind the scenes, this custom CSS is passed to a new database field on Games. Admins will be able to paste custom CSS via the dashboard.
Below are all the overridable CSS classes to customize the styling of your game:
When you're creating your game, you'll need to specifc a Game Mode. Game Modes in 2bttns are configurations that feature custom interactions and processing mechanisms. They allow for the development of unique game experiences within the 2bttns platform.
Classic Mode
is an example provided out of the box, which offers a simple user interface along with a backend system that ranks items based on user preferences.
Game Mode
The user interface and underlying data processing functionality that define how a Game is played.
Coming Soon: Additional Modes that can be installed or custom-built to support new types of Games.
Round Length
The default number of Game Objects that should appear when a user plays this Game. The higher this number, the longer the game will be. We recommend a shorter game for a more enjoyable user experience.
This value should be greater than 1 and less than or equal to the maximum number of Game Objects associated with the Game's input tags.
Erasing this value to be empty will make the game use ALL Game Objects associated with the Game's input tags.
Question
Optional question prompt the player will see as they play the game. For example, "Which is more fun?"
Item Policy
Choose how Classic mode should load Game Objects when playing the Game.
preload
Preload all Game Objects before the Game starts.
Additional policies will be added in the future, along with the ability to create custom policies.
Replace Policy
Choose how Classic mode should replace Game Objects with new options during the Game.
keep-picked
Keep the picked Game Object and replace the rest.
replace-picked
Replace the picked Game Object and keep the rest.
replace-all
Replace all Game Objects with new options.
Show Color Bar on Buttons
Set to true to show a color bar on the buttons players will see during the game. The color is a Hex color code automatically generated based on the item name the button displays.
Remember to use an !