Hi, I want to place 4 sprites on four positions randomly without overlapping.
x y cordinates:
How can I do it?
Develop games in your browser. Powerful, performant & highly capable.
This is how I would do it in pseudo code -
Pick a random sprite, set object instance var to global var. Add 1 to GV
Repeat 3 times.
You then have 4 sprites with a variable set that is 0, 1, 2 or 3.
Then you relate the instance variables to the co-ords. If 0 then set position to 100,130, if 1 then set to 160,130 etc