Monday, August 26, 2013

Z-Depth Trickery and Splat



Haven't posted in the last few days and wanted to share my latest changes.  So here goes: All civilians not enter an "injured" state if they fall longer than 2 seconds.  I probably could have use some kind of event system to figure out the distance, but I already had a variable counting down the time that each NPC is falling.  I figured that would be the quickest solution.  And what do you know, it actually worked.  

The next step is to figure out at what height I want a player to die on impact.  More importantly, I haven't quite figured out a way to graphically represent that.  I don't really want to go full out gore and use any blood.  At the moment, I'm leaning towards a puff of smoke with some kind of icon appearing to represent a lost civilian.  Tombstone? Skull? A big "-1"?  I have no idea.  I think I'll work on the smoke first.  Maybe it will come to me then.  

As far as the Z-depth trickery in the title: I noticed that I was running into some layering inconsistencies and had to make some corrections.  The NPC's are always walking in front of the player (closer to the camera).  This was fine until one of the NPC's wa on a roof top and then the player would be flying behind them (see image.  After moving some things around, I placed both NPC's and the Player on the same layer. When the player is in "platforming" mode, he is at the bottom layer.  If he's flying, he's on the top of the layer.  Any NPC that's being carried is moved to a separate layer on top of the previous layer to preserve the look of the NPC being attached to the player.

*As I type this, I'm realizing that when I have multiple NPC's around and the player is Platforming, this won't work.  I will have to add an extra condition making the player move to the top of his layer when he is carrying something.  Shouldn't be too hard in Construct 2.

No comments:

Post a Comment