Code n stuff 2

Mon Jan 29 2024

In this week's article, I built a game!

Paperfarm 📰

I was recently sucked into the world (Chrome tab) of Cookie Clicker and after playing it for a few hours off and on was inspired to finally great an Idle Clicker game I've always wanted to make. So armed with my trusty VS Code and JavaScript I began writing the basics of Paperfarm.

To start with, I built a simple money system with the ability to click a button and it add a number to the total "money" value. Then moved onto adding a game tick so that every second that passes, the "money" is increased by a "paperPerSecond" value and to cap off the basics, added saving/loading states to localStorage.

All was going well for this fledgling paper business game, but once I started adding additional items that would increase either the "paperPerClick" or "paperPerSecond" values, I ran into unmaintainable JS code issues and so moved to a Vue 3 app.

In Vue 3, development really picked up. I added both "Buildings" and "Upgrades" that increase the total money per second and started locking down some of the upgrades until certain levels had been reached.

Its current state currently has a few bugs so is yet to be published, but v0.0.1 of the game is live at paperfarm.dmdboi.dev

Big ToDo List

Big Todo List got an evening of progression towards a release too this week. This time I added Tags and the ability to add them to a Task. Additionally, I cleaned up some layout issues. As I'm going for a simple yet somewhat powerful to-do list app, the layout is the hardest part to design and build without it feeling too clunky or not simple. But I think I've settled on a design that works for an MVP and I can always rebuild it in the future 😅

The coolest part about this project is that its the first time I'm using HTMX and I'm enjoying how I'm able to make more reactive components with basic HTML and a handful of endpoints.

ServerSinc Build Servers

Finally, I spent an evening getting build servers working for ServerSinc. Build servers enable the service to take any repo and turn it into a Docker image which is a huge (and more importantly, the main) part of the system.

Behind the scenes, I'm using an Adonis server and cloud buildpacks to clone GitHub repos, build them into Docker images and then push them to a private registry.

There's a few more big bits of work to do before I have a working proof of concept, but changing ServerSinc around to use Docker is proving to be a better idea than I originally had, and I'm enjoying learning a lot of stuff I didn't know before.

That's all folks!

That's all for this week's article, if you'd like to follow along with what I'm building, check me out on Twitter or Youtube (new video every Monday)!

Happy coding 🧙‍♂️

Table of Contents