Downtown gravity

The player is now affected by gravity. And to polish upward movement, I left some parts of the code commented(if I truly need it again, but I doubt I will). Going up is more powerful than elevator music for this block. However, I need to add a ground check to ensure that the player doesn’t float up into space whenever I leave the spacebar. Speaking of which, I should make it so that the spacebar can be used to go up. Anyways, enjoy this comparison.

Before

        Vector2 direction = new Vector2(xInput, yInput).normalized;
        body.velocity = direction * speed;

After

        //Vector2 direction = new Vector2(xInput, yInput).normalized;
        //body.velocity = direction * speed;

Leave a Reply

Your email address will not be published. Required fields are marked *