2048 - WAXBadges Edition
The classic addictive block game now reborn with WAXBadges achievements! Each achievement you unlock will live forever on the WAX blockchain!
The game's JS code was forked from gabrielecirulli/2048. All thanks and credit to gabrielecirulli!
What is WAXBadges?
see the main repo: https://github.com/kdmukai/waxbadges
2048 - WAXBadges Edition is meant to be a simple demonstration for how the WAXBadges achievement platform can be easily integrated into a game. It's also just a ton of fun!
I augmented the original JS to include Achievement event hooks that talk to a simple Django website running on AWS Lambda and deployed via Zappa. The website processes the incoming Achievement events and talks to the WAXBadges smart contract to issue Achievements to Users.
The game, app, or website then just needs to add some simple smart contract interaction steps. Take a look at
cleos_util.py here: python/waxbadges2048/waxbadges2048/cleos_util.py. It's basically the beginnings of a very simple python API for some basic data retrieval from the WAXBadges smart contract. It also handles creating new
Users and granting them
Achievements. This could easily be re-used for your own project.
The rest is just a fairly vanilla Django website that uses
allauth to enable Twitter sign-ins. I specified the vars for my particular project in two places:
.env--examplefor when running the Django site locally
zappa_settings--example.jsonto set environment variables when deploying to Lambda
Customize each and omit the
--example to suit your own settings.