Loading...
16
Game
Hensen Hopper
6 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

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.

Here's a short demonstration of the beetle shell power-up in-action! It's not very obvious what it does at the moment because I still need to work on a lot of the effects for it, but the functionality is there if you pay attention to the health bar!

Okay so fast forward ~2 and a half hours of work and I've gotten an effect to play when the shield breaks! There is a sound effect too but for some reason it sometimes doesn't play... Need to figure THAT out now... v0.2.1 is on the way today!

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.

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)

Congratulations to @Freddy9207 , our #LTCOKills winner!

They posted a Mission Accomplished screen showing that they got 1,814 kills!

Check out his original Post: https://gamejolt.com/p/ltcokills-it-was-alright-vkccpcc2

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!

I added the leaf shield to the beetle since the last time I posted to Game Jolt! I've also added a detail where it deteriorates over time as you strike it with bullets which I think is a nice touch! Yes, it's a separate sprite from the beetle himself lol.

Happy #WIPWednesday! Are you working on a game? Making some art? Practicing a song? Something else? Tell us in the comments!

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.