Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Squish the player when jumping on the X axis:
- var squishAmount = 0.05;
- #region Jump squish:
- //Deform:
- if squishingJump == true{
- if squishingLand{
- squishingLand = false;
- squishScaleX = 1;
- squishScaleY = 1;
- }
- squishScaleX = approach(squishScaleX, squishScaleX - minSquishX, squishAmount);
- squishScaleY = approach(squishScaleY, squishScaleY + maxSquishY, squishAmount);
- }
- if squishScaleX <= minSquishX || squishScaleX >= maxSquishX{
- squishingJump = -1;
- }
- //Reform:
- if squishingJump == -1{
- squishScaleX = approach(squishScaleX, 1, squishAmount);
- squishScaleY = approach(squishScaleY, 1, squishAmount);
- }
- if squishScaleX == 1 && squishingJump == -1{
- squishingJump = false;
- }
- #endregion
- #region Landing squish:
- //Deform:
- if squishingLand == true{
- if squishingJump{
- squishingJump = false;
- squishScaleX = 1;
- squishScaleY = 1;
- }
- squishScaleX = approach(squishScaleX, squishScaleX + maxSquishY, squishAmount);
- squishScaleY = approach(squishScaleY, squishScaleY - minSquishY, squishAmount);
- }
- if squishScaleX <= minSquishX || squishScaleX >= maxSquishX{
- squishingLand = -1;
- }
- //Reform:
- if squishingLand == -1{
- squishScaleX = approach(squishScaleX, 1, squishAmount);
- squishScaleY = approach(squishScaleY, 1, squishAmount);
- }
- if squishScaleX == 1 && squishingLand == -1{
- squishingLand = false;
- }
- #endregion
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement