Prevent touch while object is still moving

Hi,

I’ve looked around for a way to do this but haven’t been able to find anything.

I’m using the function from the sample code “Simple Pool” to strike a golf ball in a mini golf (putt putt) game.

I want to prevent the user from being able to touch or “hit” the ball for the next move until the ball comes to a complete stop. Any suggestions on how to accomplish this would be appreciated.

Thanks,

Dave

Well you could use a Runtime listener on enterFrame and check to see if the ball’s velocity is 0 and then set a flag that your touch handler would check to see if the flag is set or not.

Thanks Rob I will look into how to do that. Still pretty new to Corona and programming in general so I’ve probably bit off more than I can chew on this one.

Well you could use a Runtime listener on enterFrame and check to see if the ball’s velocity is 0 and then set a flag that your touch handler would check to see if the flag is set or not.

Thanks Rob I will look into how to do that. Still pretty new to Corona and programming in general so I’ve probably bit off more than I can chew on this one.