Our contribution to Cloudflare Spring Dev Challenge 2022, created with π€π» by @Andifiend97 and @MatthiasSiml
RAMory is a competitive only game, built on Cloudflare Pages, Durable Objects and KV.
The goal is to collect as much RAM as possible by matching similar silicons. But be aware of different ones, they make you loose your RAM a tiny bit on each match. The player with the highest amount of total memory wins.
RAMory πΈ is built as a web application using remix.run deployed to Cloudflare Pages. Most of the template and logic gets rendered server side and communication is done in remix manner, by leveraging forms and action handlers.
After creating a board, which is indeed a durable object class deployed within a Cloudflare Worker (located under /ram
), you have to enter your username. To persist that username, we use a session storage that stores those sessions in a dedicated KV namespace called sessionStorage, surprise surprise π
Every player that puts its card into the board (what we mean by that is, every player who joins the board by opening the url in the browser) gets a websocket assigned to make the real-time playing possible. Those web sockets are getting persisted locally in the durable object which is in charge of coordinating the state between the players. At the moment a very large not that great switch case
handles all of those events and executes appropriate logics. We are looking forward into a refactoring related to this, where we want to isolate each case into it's own callback and attach it separately as event listeners. (It might be the case that there's already a issue related to that by the time you're reading this readme)
After all, the grind was real and we had so much fun creating this game that we will make it bigger and bigger, add new game modes, different chip sets and evolve it into a real online game beyond the Cloudflare Spring Developer Challenge.
PS: We have never ever participated in a developer challenge, it's the first time for us, but at the end the imagination of one day there's a swag box arriving by our doors lit up a fire within us and we are so happy to get at this point.
Thank you very much Cloudflare for making development of web applications this accessible and easy!
Best regards @Andifined97 @MatthiasSiml