Loading...
16
Game
Hensen Hopper
8 months ago

I don't know how well you can see it in this video, but I've coded a dashing mechanic for Hensen Hopper! I plan to have dashing consume a "dash charge," a kind of ammo you can get as you play in the form of enemy drops.


The way I've written this actually makes use of the sine function! Whenever the player presses shift (keyboard) or X (x-box controller), a timer counting at 10x real-time is started and Hensen's movement speed is increased with respect to the sine of the timer's value. The timer ends at Pi seconds.

code_kz9bgdkieq.png

I chose to do it this way because using the sine function as a multiplier for the increase in movement speed has the effect of blending the dash in smoothly so long as my timer starts at 0 and is stopped at Pi (because sine 0 and sine Pi both equal 0 and sine anything between those two values is a positive number <= 1). In order to modify the duration of the dash or the speed of the dash, I can simply multiply Time.deltaTime when incrementing the timer or multiply the Mathf.Sin() call respectively.

I then capped the movement speed increase to a value I can modify from the inspector which has the effect of making it so increasing the multiplier on the Sin call beyond that speed increase cap, rather than increasing the movement speed increase during the dash, increases what you could call the abruptness of the dash.

Much like everything else in my PlayerController script, the dash is triggered in the Update method based on the player's input read from the InputManager and the HandleDash method only modifies values related to Hensen's movement, which are used in FixedUpdate where the actual movement of the character in the scene is performed.

code_ymwwk7nnyn.png

One thing I'm thinking about adding to this is actual variables for the dash duration and dash abruptness (aka the multiplier on the Sin call) that I can modify from the inspector. The dash abruptness is fine, I'd just need to do a bit of planning for dash duration. I know there is a way to normalize the duration into seconds, I just need to work out algebraically what the formula is for this and then implement that into my code. I also plan on adding some effects for the dash to make it easier to tell when you're dashing which is an entire other task.

Thanks for reading!



0 comments

Loading...

Next up

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)

I DID end up making the body and elytra both 1 cycle/s and the wings 6 cycles/s. I'm working on a video of the animation itself playing in the Unity editor so you guys can see it properly. I think it turned out well!

FIRST ACTUAL EDIT USING DAVINCI RESOLVE!!! Also, FINALLY, here's that clip of the beetle's idle animation I promised a while ago.

Go tell your favorite creators to join Game Jolt and get REKT with love and support! 💓

For inspiration, here's an animation by one of our very own creators, @ElPichon !

I've more or less finished off the beetle enemy's animations now. Here's a short video showing the defeat animation as well as how it currently looks in-game. I still need to work on an effect for when the shield breaks, though.

Madeline is the main protagonist of the mountain climbing platformer, Celeste. The game has been praised for its visuals, gameplay, and introspective narrative. The game's creator Maddy Thorson confirmed that Madeline is trans in 2020.

I've been working on the sprite for the beetle shell power-up drop! I'm thinking when you collect this one, it will kind of poof away similarly to the enemies when they're defeated and play an "equip" sound.

The beetle shell is now fully VISUALLY implemented! Next thing on my list is a unique sound for Hensen equipping it.

Dive into the cozy post-apocalyptic open world of Critter Cove!

Gentleman Rat Studios (@GR-Rob ) describe it as “a little bit Animal Crossing, a little bit Stardew Valley. Maybe even a little bit Windwaker, too."

Wishlist the game: https://bit.ly/CritterCove

I've been working on some proper visual art for the beetle shell when it's equipped! I've also gone ahead and drawn a break animation for it. All I need to do now is actually set all of this up in Unity which I'll probably do on Tuesday.