I have 4 values
playerX = Where the player is on X
playerY = Where the player is on Y
Touch.X = Where the player is about to move to on X
Touch.Y = Where the player is about to move to on Y
I need to make a comparison... I need to know if the distance between playerX and Touch.X is greater than playerY and Touch.Y
Is there an easy way to calculate and compare these?
System condition Compare two values
Compare two values
First field: abs(Player.X - Touch.X)
Operator : Greater than
Second field: abs(Player.Y - Touch.Y)
(depending on the results, you might want to invert player and touch in the operation)
abs() is a system expression that will return a positive number.
Develop games in your browser. Powerful, performant & highly capable.
That worked perfectly, thanks!