Dev Blog 11: Death and Hitpoints

A couple posts back I talked about how I would need to rework my left and right Matthew sprites because the slightly turned angle was causing some game mechanics issues.  I went ahead and did just that, producing a fully facing sprite which should avoid the previous mentioned problems.  Overall I'm not that happy with it because I don't think the angle looks that nice. Before you could get more of a full face and you could make out the character as a squatty little boy, but now it looks more like a generic male character from rpg maker.  I figure I'll just let it go for now though.  I can't keep iterating on the same thing and need to continue ever forward.  At present, I also intend to allow the player to move diagonally and I've already made animations that are angled that way which look similar to my previous left and right facings.

With summer, I'm finding it even more difficult to get work done, especially because I've been gone for some days and that meant no work was done at all.  I ended up cleaning up a few issues here and there and when it came time to move on to something new, I thought to myself that I better recall what I had said earlier about 'getting to the gameplay early'.  So I began to implement the basics of life and death in the game.  Characters now have hit points and can deal damage.  They also die when their hit points go to zero.  While working on this portion I also did the art for Matthew's faint animation.  I had plugged it all in and found that the player and enemies wouldn't interact. Where before my changes they would bounce away from each other when they'd touch, they now would just walk on top of each other.  I couldn't spend the time to figure out what I broke, as I had to leave for a few day vacation that evening.

When I got back I started poking around and soon realized that I had incorrectly stopped the bouncing away effect from happening when the character was considered dead.  Well, why were they considered dead at the start of the game? Oh, that's because I forgot to initialize their hit points and all characters started out with zero.  I fixed all that up and surely it should work now. Well, sort of, but now nothing is dying. What is going on?  Oh... I forgot to initialize their damage variable also. So when they hit each other they deal zero damage.  Ug... I really set myself up for this one.

 It wasn't a big deal, but goes to show that sloppy code can happen when you're in a hurry and going on vacation in the middle didn't help. I'll have to be kind to myself and not leave things in such a state when I have to go somewhere for an extended period of time.

 

The majestic Plug.

 

Tags: