Loading...
7
Game
Hensen Hopper
11 months ago

Okay, so I've gotten the functionality for the beetle shell render over the player working! (using the first 3 frames from the beetle shell collect animation as placeholder sprites, these ARE NOT the final sprites)


So I decided to scrap the methodology I had been going with and ranted about in my previous post. Instead of trying to have a script read an arbitrary integer and set the sprite of a SpriteRenderer component according to it's value, I have put together a relatively simple script that still sets the sprite of a SpriteRenderer according to an integer key value, however, it doesn't itself know what that key should be, another script has to tell it.

image.png

From here I simply attached this script to the beetle's sheild sprite renderer and the beetle shell overlay sprite renderer on the Player and set the sprite pairings via the inspector window.

image.png

This way, for the beetle shell graphical render, I can simply call SetSprite from the PlayerEffectsHandler's update method and pass the player's damage absorptions count in as Key.

image.png

For the beetle's sheild, I wrote a BeetleEffectsHandler script that extends the EntityEffectsHandler I was using before to handle the beetle's shield effects. Before this, I had written an EntityHealthEvent struct in the EntityEffectsHandler that invoked UnityEvents when the entity's health hit a certain value solely to handle the shield's damage states and the effects for when it breaks which felt gratuitous to me since 3 of the four events did ultimately the exact same thing with slight variations and this property was not used by any other entity.

image.png

A common piece of advise that's given to programmers who are just starting out is any time you find yourself writing structurally identical code repeatedly only with differences in the values being used, try to turn it into a function/method instead. I believe the same applies in this case only with UnityEvents (which, when all is said and done, are effectively method calls themselves). That being said I also have this personal philosophy that it's best to avoid using UnityEvents if you can because they can make narrowing down the source of bugs quite difficult sometimes so I usually seek solutions that do not incorporate them so you can take this paragrap with a grain of salt.



0 comments

Loading...

Next up

I did get a lot more done on the backdrop yesterday, by the way! It's not finished by any means, in fact, it's quite empty and even ugly in some places, but it's beginning to come together!

This is just about the only situation in which I'll ever do this. I almost never put multiple calls to methods on the same line but here I've logged a warning to remind furure me to do something I didn't have time to do today in a glaringly obvious way.

Okay, so the stages and score saving are both more or less working. Your score and high score will be saved throughout the lifetime of the application. Currently nothing saves when the game is closed, though, I'll be working on that next weekend.

Doki Doki Literature Club is celebrating Monika's birthday and the 8th anniversary of DDLC with exclusive stickers, avatar frames and backgrounds on Game Jolt! 

Head over to the shop to collect yours 👉 https://gamejolt.com/#shop

I've worked out a process for drawing bushes that I'm using for the backdrop! First I draw the branches, then "paint" where the bush texture will be, copy it's alpha to a new layer in white, then draw it's shadows in a layer over the bush layer.

Play @pm-studios ' Bandit Trap Open Beta!

Grab your rocket chairs, vacuums, and toilet tornadoes! Report one more time for our final beta! Live through March 23rd 6 am CET.

Complete quests based on the game!

Play the beta: https://bit.ly/BanditTrapBeta

I've been working on the backdrop today! Among other things I've done, I made a bush! I know, SOOOO impressive lol.

Very unfinished but the backdrop image, as it is in this video, is already leagues better than what I had last weekend! I'm going to work on it incrementally over the coming weeks as I work on implementing the stages idea I talked about before!

BIG NEWS: Your Bandit can wear a Game Jolt hat and shirt in Bandit Trap!

Defend your home or steal treasure in the open beta: https://bit.ly/BanditTrapBeta

It ends on March 23rd at 6 am CET!

Been working on the artwork for the "stage complete" screen all morning! Right now I'm improving the shadows/shading for Hensen because he is a part of that screen. I do need to work out the contrast between the text and the backdrop image, I know.