Use image_xscale to slow down speed GameMaker Studio

528 views Asked by At

Using the image_xscale that increases every time an object collides with a certain object, how can I make its speed go down using the increasing image_xscale? An example would be in agar.io, where circles slow down as they get bigger. What equation using the image_xscale would I use for this?

I've tried things like this:

speed = image_xscale * -speed

but that doesn't work. Any ideas?

1

There are 1 answers

0
Dmi7ry On BEST ANSWER

You can use something like:

speed = start_speed - image_xscale * k;

where start_speed is your normal speed, without slowing.

and k is value which will define slowing factor.

Also you can add max() for define minimal possible speed (for speed can't equal to 0):

speed = max(1, start_speed - image_xscale * k);
speed = max(1, 10 - image_xscale * 0.5);