B and B week 6/20- 6/27
For my first task this week, I focused first on improving jumping. At first, I had my jumping based on a character controller, but I realized quickly that the precision given by character controller was simply not enough to be fun or to even be able to complete a level. This is due to not having direct access to physics calculations like velocity or force, as well as not being able . I needed to swap over to a Rigidbody, which I quickly decided to do once I realized the character controller was not enough.
I mentioned in a previous blog post that I could introduce a lerp that automatically jumps for you, but after considering the design and goals for this project, it seems like it would be cheating and not really a platformer at that point, rather a normal rhythm game with a platformer skin. So instead what I did to allow easier and snappier platforming is to force the user downwards whenever they are not holding down the jump button. This is a common feature in games even as early as Mario Bros. and helps with more precise landings.
if (rb.velocity.y < 0) { rb.velocity += Vector3.up * Physics2D.gravity.y * (fallMultiplier - 1) * Time.fixedDeltaTime; } else if (rb.velocity.y > 0 && isReleased) { rb.velocity += Vector3.up * Physics2D.gravity.y * (lowJumpMultiplier - 1) * Time.fixedDeltaTime; }
I also wanted the player to not have to react instantly with the song starting immediately once the level began. So instead what I did was have a 3 second countdown timer along with an extra long platform that’s the same height as the first platform in the song. This platform stops and forces the player to jump off it once the song begins. Since the scrolling speed will be based on how fast the song is, the platform’s length is determined by how fast the song is going.
For my final week I will be developing the bpm system that I can use to determine things like a background beat visualizer and metronome UI that can help the player feel the beat better. This is also used to effect the scroll speed of the platforms to be as accurate as possible with the music.