Porting Game of Snails to PHP

I’ve been playing around with PHP for the past few days. Last year for one of my One Game a Month projects I made Game of Snails. I’ve been wanting to make a snail racing and breeding game for literally years. I first started thinking about it when I discovered that video games were actually a thing - the idea was triggered by a real life snail racing experience I had when I was little in Ukraine, collecting and training snails in the rain at my grandparents' summerhouse near the Dnepr river.

Making the JS and HTML5 version of Game of Snails was a blast. I was finally able to bring this idea that I’ve been mulling over since I was something like 12 years old to life! It was very far from finished (I only had a month after all), but the basics were there - you could find, breed, and race your own snails (against other people’s snails).

The issue was that the idea in my head was never intended to be a canvas/JS game. It was always meant to be a text based browser game, in the vein of the PHP games that I was so obsessed with years ago. HTML5 Canvas simply wasn’t a great medium for all the information I had to display. In my head it was always a PHP web game, where you log in and navigate between pages to view your snails, organize your jars, interact with other people’s snails, train and race against each other, etc.

So a few days ago I started the conversion. I haven’t used PHP in years (and even before, my knowledge was introductory at best). But now that I revisit it things are going pretty quickly. Having the functionality and database structure I need already there in JavaScript form, simply requiring converstion, helps. I’m not adding anything new just yet (well, maybe a couple of things) - mostly just porting what I already have.

I think I’ll be using PHP in conjunction with JS and Canvas instead of in place of it. For example, all the snails will probably be drawn on canvas just like they are in the JS version (allowing for more flexibility and add things like movement easily, which you can’t really do that well with image sprites that are so common with these PHP pet breeding games).

So far in the PHP version you can:

So far in the MySQL database I only have a users and snails table. I will need to set up tables for things like races, jars, and items (among other things).

Revisiting my breeding formula has already given me some ideas on how to improve it. But I’m trying to force myself to not start working on anything new until after I’ve ported the entire game over.

© - 2021 · Liza Shulyayeva ·