Rotation around a point (analog clock educational game)

0 favourites
  • 5 posts
From the Asset Store
Connect the dots in the correct order and draw happy animals!
  • Hi! I'm a total noob here and trying to build a game where my little students make the hands on an analog clock match the time on a digital clock.

    I've managed to build a portion of my "game", but I'm stuck.

    Here is the file.

    If you click through the first page using the 'Play Game' button, you'll see that students are supposed to make the analog clock read 4:00. But I can't get the clock hands to move right.

    I want them to move like a geared clock, that is moving the minuteHand 360 degrees clockwise while ALSO automatically, simultaneously moving the hourHand 30 degrees.

    Or if the student moves the hourHand, the minuteHand will also automatically, simultaneously move the hourHand 360/12 degrees.

    I don't have the hourHand movement on the event sheet yet at all, because when I move the minuteHand, the hourHand jumps at 270 degrees. I assume it's because of the rotation movement type I chose, using the touch plugin.

    Can anyone suggest a better way to accomplish my objective? TIA!

  • This may not be the best solution, but here is my attempt:

    dropbox.com/s/gbaqv31tjdr94aa/clock3.c3p

  • Thank you, dop2000! I like your idea and your process for eliminating negative angles. Thinking about it that way is incredibly helpful! It still doesn't operate like a geared clock (the hour hand should rotate clockwise at 1/12 the rotation of the minute hand), so I'm going to keep working on this problem.

  • (the hour hand should rotate clockwise at 1/12 the rotation of the minute hand)

    So the hour hand should only move forward every 5 minutes? I didn't know that!

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Here's one way. When dragging it gets the signed angle difference of the amount the hand turned and multiplies/divides that by 12 to set the other hand's position.

    dropbox.com/s/tydbry8387y2dn6/clockHand_drag.capx

    After that I looked at your files. You can at least half fix it. In event 15 you can set the minute hand's angle to hours.angle*12 and that will work as expected. But I don't have a quick fix for setting the hours hand from the minutes hand. Mainly because you have to preserve the hours and I haven't had much luck preserving that.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)