Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags
(+1)

Update 06

I took the day off yesterday to avoid burning out, after struggling so much with programming the day before. Today, I decided it was time to take on one of the jobs I've been dreading: coding the actual turn-based battle system.

I have no idea how this is supposed to be done, so the first thing I did was sketch out a highly professional state machine draft on the nearest envelope.



And here's what I've managed to do so far:



The battle screen is fed whatever enemy type the player has encountered (just the bat for now) and harvests variables from it and the player's statistics. The player gets a menu, and goes to the state for whatever action they choose - just the attack option for now. I haven't built anything for processing player attacks yet, so that's as far as they can get. I won't go into all the details because the code is kind of a mess. Half of the states I've "implemented" don't actually do anything, because everything they need to do can be done directly in events run by the battle controller and menu buttons.

I quite like the idea of making the menu bar the attack timer - it just looks neat to me.

Also, it's not GIF compression or anything, the font really does look that bad. I'll have to tweak that.


Here's what the enemy variables look like for the bat:


I'm trying something a bit risky for building the target shapes for each enemy. I'm storing the shape as a 64-character string, which will be converted into an 8x8 grid by going through the string character-by-character. 0s are empty space, 1s will be one of the component squares of the shape. The advantages here are that it forms an easy visual way of building target shapes in code, and that I can implement extra types of target space square - for example, an X could be a square that must be avoided. The disadvantage is that I have absolutely no idea if this will work or not. Here's hoping!

Also, the bat's stats are just made up for now. I'll tweak those with playtesting, I expect.


One more big thing: I made a battle theme for the game! I'm very happy with how this sounds. This uses the free GenesiSF soundfont by The Eighth Bit.


Finally, I don't think he'll make it into the prototype, but here's a dragonman enemy I made: