I made a game
I thought you - I - should make a game. So I made one. It's a Trading Card Game in the browser, built with Svelte 5.
It's silly. The gameplay is shallow, it copies concepts from another game, and there's no endgame (lol). But it makes for a pretty damn good milestone, seeing as it's the first game I ever made.
Here's a link to the game and another to the code on GitHub.
Why did I make this? Because it's fun to play games and sometimes I get the urge to make one. This time I followed through. I was heavily inspired by Trading Card Game Simulator (Steam link), a viral game that got me hooked for a while.
My game is named STCG, expanded to Svelte Trading Card Game. Essentially it is a Pokemon-like card collecting game.
I wanted a small project that I could use to try out Svelte 5 and this was the perfect candidate. I got to play around with the new runes API and global stores. I really like what I've seen so far. I feel that it is easier now to manage global state compared to Svelte 3-4.
This project provided a good sandbox for wiring together various bits and pieces of state that need to stay in sync across multiple components and in computed expressions. Runes really do make this easier to handle. But I think that one of the best additions is the ability to use runes with complex logic inside .svelte.js
files to act as a global store.
You might notice that the game doesn't have an intricate UI, but I did my best to make it inoffensive, unless you hate lots of colors. The jumble of colors is intentional. Sometimes I like a rainbow explosion in my UI, and this is one of those times.
I used ChatGPT to help me with 2 things: name generation for the cards (except for one - I'll let you find it), and the animated gradient background for foil cards (nobody ain't got no time for that!)
What next? The game is a finished product, as far as I'm concerned. I do want to tinker around with it a little more, to fix minor issues, add some friction and conveniences.
Give it a try and don't take it too seriously, but more importantly check out the code especially if you're looking to implement global stores in Svelte 5.