Tommy_

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

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?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.