Game
Hensen Hopper
14 hours ago

I've set up all I need to to program the web bullet that will be fired by the spider!!! Next step: animation which I'll save for tomorrow since I work nights and wake up when it's dark out so I can listen to ghost stories in the dark while doing that.


The spider will fire a unique bullet that will be visually represented by a ball of spiderweb flying through the air. This bullet will freeze Hensen in place for a duration of 3 seconds when it collides with the PlayerController. A few changes needed to be made to the bullets and the PlayerController classes in order for this to be doable.

image.png

The first change I made was to make the bullet an abstract class. Previously, in the OnTriggerEnter2D method, I had been taking health from the entity but the spider's bullet does not take health so I decided to have an abstract method named OnCollision be called in place of doing that so I could create unique bullets that would do different things depending on how I implement that class. I feel like I REALLY should have had it this way to begin with, if I'm being honest.

image.png

To preserve the previous functionality, I wrote a DefaultBullet class that implements the abstract OnCollision method with the behavior that was present in the OnTriggerEnter2D method before.

image.png

I also went ahead and added a direction enum to the bullet rather than setting the move speed to -10 when I want it to move down like I had been doing before.

This led to a funny moment where my IDE tried to tell me it wasn't possible to apply the multiplication operator on operands of float and enum types to which I simply went "sure it is" before casting Direction to the float type which works, by the way, because enums are REALLY just a set of fancy integers. I did also manage to record this moment and you can see it here: https://youtube.com/shorts/8PTzmItL064

image.png

I also had to add a branch into the Update method of the PlayerController class in order to handle freezing the player's movement. After that was done, it was a simple matter of adding a public FreezeMovement method taking a float duration as a parameter that starts a helper coroutine that sets frozen to true and then back to false after waiting for (delay) seconds.

image.png

From here it was a simple matter of creating a new child class of Bullet that would call this FreezeMovement method OnCollision instead of damaging the entity. Something I love C# for, by the way, is pattern matching. Imagine if I had to check whether the otherEntity object had a PlayerController component and then GET that component? Honestly, I think I childed PlayerController to the Entity class SOLELY so I could do this in particular.



0 comments

Loading...

Next up

Been working on the artwork for the spider enemy!!! This is a preview of what it'll look like in-game. I am gonna remove all of these drop shadows as I usually apply those to the spritesheets themselves once I've drawn the animations.

The gang's all here!

THE SPIDER IS COMING

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

Working on animating the spider! Like I did with Hensen and the other enemies, I'm doing it in layers, starting first with the web and now with the propeller thingy on the back.

Mae Borowski is the main character of Night in the Woods! It's an adventure game that tells the story of her return to her hometown of Possum Springs. She was confirmed as canonically pan in a social media post by the game's creator Scott Benson.

HIS HANDS ARE ANIMATED NOW!

Okay so I've effectively phased out the profile selection menu, or, well, TECHNICALLY not. The profiles system is still there, it's just invisible now. There is only one profile that's either created or loaded on game start. No more profile choosing.

The Knightling launches on August 28! Wishlist it now so you don't miss out: https://bit.ly/KnightlingSteam

To celebrate the game's impending release, we've added The Knightling Pack and The Knightling Community Pack back to the Shop!

Last post for today! Been getting some work done on the art for the spider, so far I've drawn a colored concept art (I know I completely messed up the web) and got started on the actual sprite, well, at least the layer that will be the spider's web.