bsoc-bitbyte / 2D-Platformer

0 stars 9 forks source link

Added Player Movement Script for player controls like jumping and running. #9

Closed Captain-T2004 closed 1 year ago

Captain-T2004 commented 1 year ago

Overview

  1. This PR fixes or fixes part of #8
  2. This PR does the following:

Used the new Input System(2022) from Unity to implement player controls in the game.

Jump: A ground layer was required to make sure only single jump takes place, also jumping force is double if the jump key(spacebar) is held for longer.

Running: Used the horizontal value from InputAction to get the direction of motion and used it to establish running.

Jump Force is set to 5f. Speed of motion of player is set to 8f.

Proof that changes are correct:

https://github.com/bsoc-bitbyte/2D-Platformer/assets/126911424/e1b4f0f6-5482-4433-801b-35e4e4898b0e