Macropterus

Dev Blog # 1

While I've been writing up some summaries to share with friends, I thought I'd stop spamming them and simply set up a little dev blog where I can write in more detail for those interested.

The last two weeks have been slower going due to real life distractions and, more interestingly, thinking about how my code actually needs to work. But first, let's talk about a couple of new features.

New Features:

Health and ammo pickups! Basic stuff. They are spawned in (with a random offset to keep them from looking 'griddy') when grass is cut. A little bit of a bounce animation as they drop would look nice, but is not implemented yet.

Macropterus

Also pictured: Grass tile variants

A new enemy type. This is a basic octorok style enemy. He inherits all his movement behavior from the normal cave spiders, but checks every frame to see if the player is in front of him, and if true, shoots a new 'bullet' projectile.

Macropterus

Darkness! Some maps can have the 'isDark' property, which covers the screen in darkness. This was partially an excuse to learn Love2D stencils. The best I understand, stencils let you use the drawing tools to assign values to pixels on the screen, and then only draw on pixels of certain values. So I can stencil a circle around the player, and draw a black rectangle over the rest of the screen. And with some layering, I can even get a basic gradient ring of bright, dim, dark. I included the ability to also stencil around 'torches' a new item type just for this.

Macropterus

I added a bit of a flicker to the radius of the light to add some atmosphere. Overall, I'm proud of how this effect looks, and I like the aesthetic of a giant melty candle instead of a standard torch or brazier.

And lastly, death! Being reduced to 0 hp now simply re-initializes the player and the world. Nothing sophisticated, but now I can't bumble through while testing and get to -10 hp.

Structural changes

This is the more boring stuff that doesn't give me much to show off. I'm in the process of redoing my input handling, and having a dedicated input.lua that all input is in. As I learned, I had multiple checks in the Player and Main, and it was getting messy. Having it all in one place also allows me to organize all the inputs by game and player state, which should hopefully make my life easier. A more thoroughly thought out state machine is a problem I'll need to tackle soon.

This may be an unnecessary rabbit hole, but I've been trying to get the game 'pixel-perfect' as in, all pixels of the pixel art are made up of the same amount of actual resolution pixels. Initially, my pixel art could be placed on half pixels, and certain effects, such as drawing circles or lines, or scaled sprites, were at obviously higher resolutions.

First, I brought in the Push.lua library, which should force integer scaling, but I kept noticing columns of narrow pixels which were driving me crazy. It was here that I realized that my chosen resolution was completely arbitrary (I'm guessing I copied it from a tutorial and never rethought it) and I needed to change it. That does mean that all my maps made for 480 by 320 need to be redone. I also needed to come up with a new resolution. My needs are basically: it needs to be multiples of 16, since that's my tile size, and 16:9 to keep it widescreen.

So I'm not married to it, but I'm working in 512x288 resolution for now. Now that I've settled on that, I've redone my rendering to now render to a 512x288 canvas, and then scale that up by an integer to keep it nice and crisp. Fingers crossed I'm still happy with how it looks in the future.

And that's it for now. I'm hoping to maybe work on some level design for a bit, which I think should help inform me of what other features I need to add.