DEV Community

loading...

Startup CliX: Finally some Gameplay

kayis profile image K Updated on ・1 min read

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:

  1. Player opens game URL Browser -> GitHub Pages
  2. Player requests game Browser -> API-Gateway -> Lambda
  3. Back-end queues player Lambda -> DynamoDB
  4. Player joins game Browser -> Pusher
  5. Back-end starts an execution of the game Lambda -> Step Functions
  6. Back-end sends game:start event Step Function -> Lambda -> Pusher
  7. Players receives initial capital via game:start Pusher -> Browser
  8. Back-end sends round:start event Step Functions -> Lambda -> Pusher
  9. Players receive round:start event and can now click/sell products Pusher -> Browser
  10. Players click/sell products Browser -> API-Gateway
  11. Back-End saves sales Lambda -> DynamoDB
  12. Back-End calculates profit of the round Step Functions -> Lambda/DynamoDB
  13. Back-End sends round:end event with profit to players Lambda -> Pusher
  14. 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

Discussion (1)

Collapse
peter profile image
Peter Kim Frank

Hey K, I just wanted to mention that I'm really enjoying watching this come together. Pumped to see it in action soon!

Forem Open with the Forem app