Changed the way moving and jumping works. I depreciated the release() method of keyboard, because ideally the keyboard class should contain an accurate representation of what keys are held down at what time. I also got rid of the velocity class, and made the player handle his own velocity.

One glitch I noticed before was that if you jumped underneath a platform, you would get stuck for a second. This was because the player kept his vertical velocity, which meant even though he could not move up, you would have to wait for the velocity to decelerate for him to start to fall. I fixed it by making collision set speed to 0, but that messes up my animation a bit.
Changed the way moving and jumping works. I depreciated the release() method of keyboard, because ideally the keyboard class should contain an accurate representation of what keys are held down at what time. I also got rid of the velocity class, and made the player handle his own velocity.

One glitch I noticed before was that if you jumped underneath a platform, you would get stuck for a second. This was because the player kept his vertical velocity, which meant even though he could not move up, you would have to wait for the velocity to decelerate for him to start to fall. I fixed it by making collision set speed to 0, but that messes up my animation a bit.