Dev Update #1


Some progress on a game I'm developing for the Jammin game jam (https://itch.io/jam/jammin-2019). 

The theme of the jam is Growth. My goal was to come up with an interesting mechanic that can be used with the theme. I eventually settled on a type of pre-programmed input mechanic. Basically, you have to draw a path that the main character will follow. When the character gets to the end of the path, it starts following the path again but from wherever it stopped. This is repeated until the character hits all of the objective points, hits an obstacle or flies off the screen.

For the character, I settled on a butterfly because I wanted the game to be about making flowers grow (for theme) and also because while testing out the character's motion along the path, it felt a bit jittery, sort of like a butterfly flitting around.

I'm using Phaser to build the game. I spent a good deal of time trying to get the drawing part to work. Initially I thought I could just draw to a render texture like in this example: RenderTexture Paint. I didn't like that if you drew too quickly, it would just draw discontinuous dots. I really wanted a smooth, continuous drawing like in this other example: RenderTexture Paint Interpolated. Unfortunately, the interpolated paint was really slow on mobiles and I needed this game to work on both desktops and mobile devices. I eventually decided to use a Phaser Graphics object instead so that I could use moveTo and lineTo methods to ensure a continuous set of lines. The final effect actually uses both RenderTexture Paint and Graphics to give a spray-painty look.

In order to get the butterfly to fly along the path the player draws, I captured all of the points whenever the pointer was down. I figured I could simply tween the character along those points to recreate the path but this turned out to be a terrible idea because the timing would go all wonky and it just didn't look visually appealing. Instead, I used the path generation capabilities of Phaser to dynamically create a Spline path out of the set of points captured. This worked out really well as Phaser allows you to easily make sprites follow a path and even orient themselves to the path.

There are a bunch of things that still need to be worked on such as obstacles, sounds and levels but I'm pretty happy with the core mechanic so far.

Leave a comment

Log in with itch.io to leave a comment.