Jump to content

phaser 3 sprites with random x,y but in a specific area


Tommy_
 Share

Recommended Posts

I have some sprites in a group with random x,y. and i want those x,y be somewhere on my lets say ground area (which is a circle graphic object). what is the best way to do this?

I was thinking about something like this: in update check if the sprite x,y overlap (contains) with ground or not, if they do let them be if they don't destroy them and make an other random x,y and so on. but since those sprites are too many and overlap area (ground) it's not that big it would effect on performance I guess(it will?).

So is there a better way to do this?

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...