Game Dev Diary: A distraction, or a new path??

By X-51 | Game Dev Diary | 20 Jul 2020


I haven't worked on anything game-related for a while given everything else going on in life, but Saturday afternoon I felt like getting back into it.... but I didn't really feel like butting heads with the problems I was having previously just yet - I wanted to see something, anything, real come from my afternoon's work, and that kind of ruled out attacking that previous problem for now because there was the very big chance of getting nowhere.

So I decided to take a previous small side-project - a modified version of the official tutorial that started me on Phaser 3 - and make it a bit more "mine".

I'd previously modified it to add a persistent high score list using local storage, a "play again" button when the game was over, more variability in where the stars spawn, and some adjustments to the hitboxes, but nothing really major. I'd actually posted it here on my old website for some friends to have a play around with, then kind of forgot about it for a while. If you want to have a play the controls are just left & right arrows and space to jump. No mobile controls though. My highest score since implementing the persistent scoreboard was 960 if you want to challenge me 😅.

So Saturday afternoon I started on what was supposed to be just a re-skin, swapping out the graphic resources for something a bit more my style, but it ended up turning into a bit of a monster (in more ways than one).

 

First I swapped out the static bouncing bomb image for an animated bat sprite (because, hey, why not??). But they looked really stupid bouncing around the screen so I stopped them being affected by gravity so they could fly more naturally. Then they looked really stupid flying so fast, and some of them just up and down with very little horizontal movement. So I modified their potential range of horizontal & vertical velocities to give more natural movement patterns, plus added more variability in where they could spawn. Then I added 3 different animation speeds based on their velocity so slower moving bats would flap their wings slower, and faster bats would flap faster. I also spawn 2 bats at the start of the game to give at least a little challenge, since the previous code you could score 120 points with absolutely no way to die.

Then I swapped the stars for candy canes (again a bit of a random choice), and used a sprite instead of a static image so I could randomize their colour. This put me on the train of thought of making it a Halloween themed game (I might be Australian but damn I love Halloween!) where you are trying to collect your lost candy in the woods while dodging monsters.

So I added a ghost type monster, since they are pretty much the most iconically Halloween monster out there. They move a bit slower than bats on average, and can take a more vertical path since they are floating. Where bats "bounce" off any platform they hit, ghosts pass straight through the platforms and only turn when they meet a screen boundary. This gives a bit more chaos to the gameplay too now that you have to watch for ghosts about to pop through the platform you are walking on or under.

Next I figured out how to flip the monster sprites based on their velocity - both sprites were left-facing to begin with, and all I had to do was check if their horizontal velocity is greater than zero when they collide with a screen boundary or platform, then flip the sprite by setting the flipX property to true, otherwise set it false. Easy!

Then I replaced the plain background and the platforms with something more creepy/woodsy, and changed the way the candy canes were created to be more variable. The original tutorial just had a set number of stars spawning at regular intervals across the screen - I wanted more fine-tuned positioning, plus a random element to how many candy canes would appear each time. At the same time I moved the code for creating the background, platforms, and candy canes into a function, and the definitions of where they are and what images to use into a levels array, so later on I can add more levels without too much hassle.

 

So far so good, but then I hit a small snag.

I was looking for a good character resource for a Halloween theme, but the only things I could find were monster types!

So I adapted the concept to work with the resources I had. The player is now a little witch helping her big sister witch cook potions and stuff in the cauldron by hunting for ingredients 🤣

 

The candy canes have since changed to pumpkins, jack 'o lanterns, bat wings, bones, candles, eyeballs, little cauldrons of goo, and green claws. But these might change slightly again because I'm now having some pretty grand ideas about this little distraction!

Now I want to add a few more monster types. I want to add a health mechanic so you don't die as soon as a monster hits you. I want to have set recipes you are trying to gather ingredients to make, which will be how you score. I want to add some power-ups to the game. I want to add more levels, with some progression of difficulty too. Plus a bunch of other ideas.

 

So my little weekend distraction has turned into something interesting!

My Lovecraftian mystery game isn't going away, I will still get back to it at some point, but for now I really like the fact I have something lightweight that is already playable, and can be improved in small increments when I can find the time and motivation.

 

Unfortunately I can't post a link to the current version yet - I just double-checked the licenses of the different assets I used and one of them is very badly worded, so I checked the original source and it has since been updated from free to paid with some wording changes. While technically the fact I received it for free under the license agreement shipped with it means I can use it as such, I'd prefer to not be that "well technically...." guy, and either buy the assets so I can legitimately use them, or replace them with something that has a less ambiguous license or for which I have already paid.

But once I resolve that little licensing hiccup I will definitely post it.

How do you rate this article?


4

0

X-51
X-51

Software developer, musician, photographer, traveler, crypto enthusiast


Game Dev Diary
Game Dev Diary

A place for me to document the processes, decisions, challenges, and struggles of creating a video game.

Send a $0.01 microtip in crypto to the author, and earn yourself as you read!

20% to author / 80% to me.
We pay the tips from our rewards pool.