• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Legacy GM Comparing xscales

Sk8dududu

Member
Although I have found a workaround, it is a pain in the ass and I would like to condense this down to as little/simple as possible.
What I would like to achieve is for my character object to compare it's xscale value to the enemy when they collide. (Think like a hungry fish type game, if you are the larger fish, then you can eat the smaller fish)
What I had tried first is the following:
Character, collision event with enemy
Code:
if image_xscale >= other image_xscale{
do stuff}
Now I understand that this just doesn't work, and why, but I don't know how to write it so that it only effects the other object its colliding with, without making a variable and multiple collision events.
 

TheouAegis

Member
That does work if you wrote it right.

Collision Event:
if image_xscale >= other.image_xscale {
instance_destroy(other);
image_xscale+=0.5;
}

You could do it in code, but it's the same thing.
 
Top