Home Artists Posts Import Register

Content

We've got some slime critters bouncing around the Action RPG now.

It took me longer than it should have to decide on how exactly I wanted to structure "Enemies" but I'm happy with where I ended up. As I've talked about at length already now: trying to optimize the structure of a game is tall enough of a mountain, trying to optimize the structure of a tutorial based on any possible video game in this genre ever is an utterly bottomless pit.

That said, what I'm doing is pretty modular. We have pEnemy as an object which is itself a child of pEntity.

So all our enemies inherit generic 'enemy' structure and also inherit the behaviours and flags of generic "entities". This means technically you can create an enemy that can be lifted and thrown, just like the rocks, without duplicating any code:

...It's buggy when quickly combined with regular enemy behavior like this, but it's a possibility!

The enemy base object contains a state machine that will execute a script based on the enemy's state. Those scripts are defined in the eventual child object that represents a specific enemy type, such as oSlime in this case.

This lets different enemy types share scripts, as not every type of enemy will necessarily move, attack, get injured, idle or die in entirely different ways. This is again, a saving in terms of code duplication.

The code is also all there for enemies to be injured, and flash white with a simple shader effect (Done a tiny bit better than our platformer flash, too!), but we need to code the players ability to attack things, and for that we also need to animate those attacks.

I say it often, but really, thank you for your patience. I hope it's becoming clear that I really meant it when I said this stuff would take a while and I hope these updates are enough to keep you excited for this thing.

Code has been updated for Arch Magi who want to dive in to the nitty gritty of all the above.

Thanks for everything, as always. Will hopefully see some of you this Friday for the regular twitch livestream!

-S

Files

Comments

No comments found for this post.