Last Updated: 2/22/23

Grass Effects and Numeric Springing
2/22/23

Relevant Links:
Numeric Springing Math - Allen Chou
Alternate Example of Grass - JP Kotze
Implementing Numeric Springing in GMS2 - Bless Hay Gaming



When I was trying to create the effect above, I found a lot of the resources VERY confusing, so im going to try to explain how this works in a way that I understand it.

The name of the technique used for this effect is called Numeric Springing. --Effectivly you are passing the current value, the target value, and the speed it will use to get there. For example, if you wanted to have an item bounce as it moves, simply set the target location as the location it should move to, then every time the script runs it will move it closer to the target and have it overshoot the target and bounce depending on your parameters.

This can be used for nearly everything, because the actual math only requires one value to change you can use this to have a wiggly rotation, sliding movement, even clothes. In my example, i am taking advantage of this by having slightly different math to distort the sprite for x and y values, making the distortion less when the player is above or below the sprite. I plan to use this effect for all grass/plants, and to add some simple aditional animation to enemy bullets and enemy animation.

If you are interested in the full math behind this effect you can check out the top link above. If you want to see another version of this effect check out the second link, and in the third link there is a video showing the code for this in GMS2 (the program my project is coded in as well)