How to set an object into pendulum motion in Sketchware?

How to create a pendulum in Sketchware?
Here is a video of how I created a pendulum in Sketchware:


Firstly​, in View field create a pendulum in a linear horizontal block, either using an imageview or textview. It should be such that the pendulum lies horizontally in right half of the linear horizontal block.


Next, create a new timer, and a new function.

Add a new variable t and set it's​ value to 0 in onCreate event. Also set rotation of textview to 90°.

Now define the new function in such a way that the linear horizontal rotates in pendulum motion repeatedly. Use the codes as shown in the image below.

And then save and run the project. It will show your image or text in pendulum motion.

Comments

Post a Comment

Popular posts from this blog

A Flash Light App in Sketchware

Create Music Player app in Sketchware

In Sketchware: How to create a calculator for any simple formula?

Simple car racing android game in Sketchware

Firebase auth in Sketchware for Login Activity