Help!

Hi All,

 

In my game I need to move the hour hand clockwise only.I need to restrict the counter clock wise moving/rotation of hour hand.May I know how to restrict the counter clockwise direction of hour or minutes hands (Object) in Corona SDK?

 

Thanks…

 

Best Regards,

John

This really depends on how you are moving it.

Are you using physics, or are you just changing the rotation property of the hand?

I don’t use physics.I would like to just change the rotation property of the hand.

ok, well then I’m not entirely sure where your problem lies.

To rotate an object, just do:

hourHand.rotation = hourHand.rotation + degreesYouWantToMove

You’re not clear on how you want to restrict it. If you simply mean you don’t want it to rotate counter-clockwise, then just make sure you are always adding to the rotation property, and not subtracting.

--add: move hand clockwise hourHand.rotation = hourHand.rotation + 30 --subtract: move hand counter-clockwise hourHand.rotation = hourHand.rotation - 30

This really depends on how you are moving it.

Are you using physics, or are you just changing the rotation property of the hand?

I don’t use physics.I would like to just change the rotation property of the hand.

ok, well then I’m not entirely sure where your problem lies.

To rotate an object, just do:

hourHand.rotation = hourHand.rotation + degreesYouWantToMove

You’re not clear on how you want to restrict it. If you simply mean you don’t want it to rotate counter-clockwise, then just make sure you are always adding to the rotation property, and not subtracting.

--add: move hand clockwise hourHand.rotation = hourHand.rotation + 30 --subtract: move hand counter-clockwise hourHand.rotation = hourHand.rotation - 30