This is a asset for GameMaker containing a script and some examples that allows you to have custom sprite effects that don't interfere with collision! These effects are perfect for conveying motion, so use them both on sprites with no animation, or sprites with multiple frames!

After setting up the correct events, you can simply call one of three functions to get an effect:

shove(x,y) "shoves" the sprite in any direction, then it'll snap back into place. Press the RIGHT arrow key to shove the blue character in the example.

flick(angle) "flicks" the sprite to any angle, then it'll snap back into place. Press the UP arrow key to flick the hearts in the example.

stretch(x, y) "stretches" the sprite to any scale, then it'll snap back into place. Press the DOWN arrow key to stretch the slime in the example.

The download contains a .yymp that can be imported into GameMaker. Also included are instructions, but you can also view the included video.
NOTE: THIS ASSET IS ONLY COMPATIBLE WITH GAMEMAKER 2.3 AND LATER

Purchase

Buy Now$3.99 USD or more

In order to download this asset pack you must purchase it at or above the minimum price of $3.99 USD. You will get access to the following files:

Sprite_Effect_Asset_2022_10_5.zip 228 kB

Comments

Log in with itch.io to leave a comment.

Hey, I was wondering if there was any way to get other draw commands to work along side this. For example I can't use something like image_blend when an object is using this script. Thanks :)

Cant seem to get this to work, any help?

Hello! Sure, but I'm going to need more info than that! How far did you get? Did you find the instructions? Did you create an object with the CREATE, STEP, and DRAW event functions? Let me know.

Hey, I was able to make it work by looking at the examples but I was a little confused because it says  parameters inside [] are optional but if I just call the function, it dosent work. One more think I got confused on is how I call the stretch function, it’s a different color than the other 2 so I though the shove and flick were not working but yeah, they all need at least 1 parameter I guess and that’s why I couldn’t get it to work 

(2 edits)

When I attempt to run this, clicking the right arrow causes the entire project to error out. It throws an "undefined value" error. Coming from the update function going all the way down to the "gml_Script_numeric_springing" function at line 166. 

I've been glossing over the code and can't seem to find where the undefined variable is.

First, make sure you have GameMaker 2.3 or later.

Secondly, can you post the entire error message? That would help me to identify! Thank you.

ERROR in
action number 1 
of  Step Event0
for object obj_character:
undefined value
at gml_Script_numeric_springing (line 166) -        _delta_x = (1+2*_t*_damping*_ang_freq)*_x+_t*_v+power(_t,2)*power(_ang_freq,2)*_x_t;
############################################################################################
gml_Script_numeric_springing (line 166)
gml_Script_anon_Sprite_Effect_gml_GlobalScript_pkg_sprite_effect_3599_Sprite_Effect_gml_GlobalScript_pkg_sprite_effect (line 145) -               _numeric_array = numeric_springing(y_shift_effect[0], y_shift_effect[1], 0, 1 * y_shift_effect[2], y_shift_effect[3], 1);
gml_Object_obj_character_Step_0 (line 4) - sprite.update();

I'm on the latest version of GM (2022.8.1.37)

(+1)

This was very helpful! I've added a new version that should resolve this. shove() required 2 arguments, but only one is supplied by default. I've made all arguments optional with the new version.

Thanks for your feedback and patience. Please let me know if this version works for you.

Thanks for the quick fix. I plan on using this in a jam game. I'll drop a link when I get it finished.

I'd love to see it! Thanks for using Sprite_Effect()!