How to make a Pendulum on Snap

I need help coding a working pendulum. I am trying to make a game where the user can swing a pendulum using their mouse/ trackpad to college coins.

You can use a sin wave generator mixed with some rotation code to make a pendulum.

Good question! If you think about it conceptually, the user is moving around the stage with the mouse/sprite, to interact with an object. So, it might be helpful to use some of the coordinate sprites. If the mouse/pendulum is touching (or at the same coordinate) as the coin, then you want to collect it. Depending on how you want your pendulum to work, your implementation will change a bit. For example, if the mouse moves to the left - how would the pendulum respond? Would it immediately follow the mouse or could it glide and sway to that coordinate? Either way, using coordinates with both the mouse, pendulum, and coin objects will be a good staring point

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.