Progress on “flying space rocks” using CoronaSDK

Just wanted to post my progress on the mobile development I have been doing with CoronaSDK. I started out building this game in Flixel in the Flash Player. Development was pretty easy and I got most everything ported over but there are of course some differences when it comes to working with the physics in Corona. (thanks Matthew Pringle for the help )

The problem I was running into was how to get the Rocks to fly around randomly and also detect when they move off screen in order to place them on the other side of the screen just like in the classic game. The forums on the ansca site proved to be very helpful after some tweaking on my end.

I am not sure if I am detecting the objects going off screen in a very good manner as there is more than likely a more optimized way of doing it. I am basically using an enterFrame event to check all the x and y locations and then preforming some checks to place the object where it needs to be if it goes off screen. Below is the code for applying the phisics and also my enter frame function that I am using.