This just has some basic platformer code to control jumping, falling, and running into objects. I created this project to answer a question in the discussion forums. Arrow keys to move and jump.
This project uses variables called xVelocity and yVelocity to move Scratch Cat. xVelocity is the speed Scratch Cat is moving in the x-direction. yVelocity is in the y-direction. In the x-direction, when right or left arrows are pressed, Scratch Cat moves 8. If it moves into a platform, it keeps backing up 1 until it is no longer touching. In the y-direction, when up is pressed, Scratch Cat will jump, and its y-velocity becomes 30. Then y-velocity keeps decreasing by 3. So Scratch Cat will move up 27, then 24, then 21 and so on. This creates an effect like gravity. First Scratch Cat is moving up more quickly, then slows down until eventually the y-velocity is 0 (the top of the jump). y-velocity will keep decreasing and become negative, so Scratch Cat moves down. First more slowly, then faster. This continues until Scratch Cat is touching a platform and stops. If Scratch Cat's y-velocity is positive (moving up) and moves into a platform, he is shifted down by 1 until no longer touching. The opposite is true if y-velocity is negative (moving down). He is shifted up by 1 until no longer touching.