I have an array called “slime_positions”
And I want to add the values of “random_position_slime” only if there are no equal values in the “slime_positions” array
You’ll need to iterate through each entry in the array and check the x & y positions are the same.
A simpler method, if you only need to check it exists, is to make slime_positions a structure, and only store the X & Y with a separator as a key. Then you only need to check the child exists, using the X & Y with separator.
Something like the following, where the separator is a semicolon (“;”):