Game
Hensen Hopper
22 days 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

The spider is more or less complete functionally AND artistically! I might try to update the enemy spawning algorithm before I release any new alpha builds with the spider, though. I'm on my whiteboard trying to think through that problem.

AAH! SPIDERS!

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!

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 been working on improving the backdrop for Hensen Hopper! The way I'm doing it this time is I'm creating a 32x32 image for each texture I want, tiling it to fill the backdrop image, and using layer masks to "paint" where that texture will be visible.

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.

The gang's all here!

HIS HANDS ARE ANIMATED NOW!

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!

This is a short video showing off the new procedurally generated enemy waves in Hensen! In theory, the game will become more and more unpredictable as I continue to build and implement new enemies!!!