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

Simple car racing android game in Sketchware

Creating a Drawing View in Sketchware

Enable Fullscreen for Youtube videos in WebView

How to enable upload from webview in Sketchware?

List of Calendar Format symbols valid in Sketchware