Today I did nothing haha.
But yesterday I implemented some basic gameplay with the help of DynamoDB and Step Functions.
Gameplay
At the moment it goes like this:
- Player opens game URL
Browser -> GitHub Pages
- Player requests game
Browser -> API-Gateway -> Lambda
- Back-end queues player
Lambda -> DynamoDB
- Player joins game
Browser -> Pusher
- Back-end starts an execution of the game
Lambda -> Step Functions
- Back-end sends game:start event
Step Function -> Lambda -> Pusher
- Players receives initial capital via game:start
Pusher -> Browser
- Back-end sends round:start event
Step Functions -> Lambda -> Pusher
- Players receive round:start event and can now click/sell products
Pusher -> Browser
- Players click/sell products
Browser -> API-Gateway
- Back-End saves sales
Lambda -> DynamoDB
- Back-End calculates profit of the round
Step Functions -> Lambda/DynamoDB
- Back-End sends round:end event with profit to players
Lambda -> Pusher
- Back-End sends game:end event if only one player is left
Step Functions -> Lambda -> Pusher
SQS is probably better suited for the task DynamoDB handles at the moment, but it was only one line in AWS SAM to setup a DynamoDB table, so I went with that lol.
Next
Tomorrow is dedicated to the mobile readiness of the front-end and some clean-up. Hopefully some end user tests and then I'm ready to go :D
Top comments (1)
Hey K, I just wanted to mention that I'm really enjoying watching this come together. Pumped to see it in action soon!