There’s 2 things I need to accomplish, 1 is I need to stop objects (which are moving on there own) from leaving the screen, and when they touch the edge, they flip horizontally and bounce back. Is there any documentation on this?
You’ve got a few ways to accomplish that.
For example, you can use physics. Set 4 walls at the border of the screen with bounce = 1, and give a body to each object, they should properly bounce back when hitting a wall.
You can also use enterFrame events to check for each object position. If their contentBounds.xMax is higher than the right side of the wall, for example, you change their speed to -speed and they xScale to -xScale.
You’ve got a few ways to accomplish that.
For example, you can use physics. Set 4 walls at the border of the screen with bounce = 1, and give a body to each object, they should properly bounce back when hitting a wall.
You can also use enterFrame events to check for each object position. If their contentBounds.xMax is higher than the right side of the wall, for example, you change their speed to -speed and they xScale to -xScale.