Clock rotation by touching

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

  • SocksSocks London, UK.Member Posts: 12,822
    edited October 2014

    ...

  • murdeck82murdeck82 Member Posts: 18

    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?

  • jsorr2jsorr2 Member Posts: 279
    edited December 2014

    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

  • murdeck82murdeck82 Member Posts: 18

    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.

  • murdeck82murdeck82 Member Posts: 18

    correct:
    MinuteHandRotation= HourHandRotation*12
    HourHandRotation= MinuteHandRotation/12

  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,880

    This is a little confusing to me. What are you asking to do?

    Or are you explaining how to do something interesting?

  • jsorr2jsorr2 Member Posts: 279

    Make a variable called turns. If minute hand angle = 0, then turns = turns + 1.
    Then count how many turns for your hour hand.

  • murdeck82murdeck82 Member Posts: 18

    .

  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,880
  • murdeck82murdeck82 Member Posts: 18

    Thanks RThurman !!!

Sign In or Register to comment.