Learn You a Game Jam - Day 3 Friday!


I'm going to keep a work log tonight.  

First thing, tried out animating the Slime... DamageZone's.... Collider.  Basically I'm making the slime's "attack" a pulsating DamageZone that shrinks briefly below the Slime body collider every .5 seconds.  This ensures player/ally colliders can't be in the attack zone for moment, resetting the DamageZone's on_body_entry signal for all these bodies and triggering them again quickly after.  It's not perfect (its easy to get double tapped in rapid succession), but it works as a consistent damage dealer.

Next I need it to have an effect.  Which means HP and stat tracking.  I'm aware that Stat Sheets are a good place to start for the "Make it a Resource" thing, and I'm going to take a stab at making one.  I want to make a resource that creates a bunch of stats and flags for "characters" in the game - the MainTank, Guildies, and Enemies, and other NPCs should all more or less work the same except how the are controlled and what collision layer they are on.

Once I got the difference between the script part of a resource and the actual resource itself things went much better.  I have Name, Health, and Strength as exported variables my starting stats so I can run basic combat.  Just starting to understand how powerful this is going to be.

I like being able to update whatever Stats any Character will need in one place.  As a test I add an Intellect Stat in the script and sure enough it carried down to the generic Slime with regular slime stats as established in the Slime scene, as well as Frank, the Viscous, a unique slime with his own StatSheet who has more HP but less strength and a cooler name.

The I added exported the StatSheet class on my Main Tank scene, and sure enough I was able to set them and have them carry over the main game scene.  Now all my characters will share the same stat sheet template.  Very cool.

I'm getting it!

I will keep an eye out for how Godot uses resources now that I have a bit better understanding of how they work.  Powerful stuff.

I added a damage variable to receive_damage() function  that gets called from the DamageZone node so that it can pass a value to the thing it damaged, which can deduct it from its health (now available from the Stat sheet!)  I added a color modulation animation to flash the MainTank sprite red, but otherwise keep animating the same when it takes damage.  Even added a progress bar above his head to watch the HP tick down as he gets hit.


Get Guildies

Leave a comment

Log in with itch.io to leave a comment.