Clock rotation by touching
murdeck82
Member Posts: 18
I want to make a clock with the ability to move the arrow by touching. There are minute and hour cloks which may rotate . Use 'rotation' behavior to reconcile minute and hour hands. How I made it for minute arrow: self.rotation=game.smallarrowrotation*12, and for hour arrow: self.rotation=game.bigarrowrotation/12. Then minute arrow finish a circle, the hour arrow return back to start position because "game.bigarrowrotation/12"=0. How to do so to continue to move the hour arrow at the rotation?
Comments
...
There are watches with minute and hour hands. Arrows can be rotated by touching\moving. It is necessary to: 1. if hour clock rotating , the minute rotates also, 2. if minute clock rotating , the hour rotates also. How to make it?
if minute hand divisible by 5, make hour hand + 1 (loop minute hand while touch is pressed). change rotation of hour hand according to its value from minute hand. You're instructions are very vague
Rotation arrows shall be as at the real clock. When the minute hand rotates 180 degrees, hour hand rotate to 15 degrees. When minute hand rotates 360 degrees, hour hand rotate to 30 (1 hour). When rotate hour hand to 90 degrees, the minute hand rotates by 1180 degrees (3 full turns).
MinuteHandRotation= HourHandRotation/12
HourHandRotation= HourHandRotation*12
The are is no problem when I rotate hour hand.
The problem with hour hand when I rotate minute hand, because when the minute hand makes a complete revolution (360 degrees) again its rotation angle = 0, and hence the hour hand goes back to 0 from 15 degrees.
correct:
MinuteHandRotation= HourHandRotation*12
HourHandRotation= MinuteHandRotation/12
This is a little confusing to me. What are you asking to do?
Or are you explaining how to do something interesting?
Make a variable called turns. If minute hand angle = 0, then turns = turns + 1.
Then count how many turns for your hour hand.
.
Perhaps the following will be helpful:
http://forums.gamesalad.com/discussion/comment/508971/#Comment_508971
Thanks RThurman !!!