How to build a moving platform that goes left and right on the screen?

I want to make a moving platform that a character can jump on but the platform is constantly moving left and right across the screen only horizontally with no vertical movement. The best i could find was in sample codes==> Getting started==>Frame Animation 1 code where a fruit moves all over the screen. I tried to isolate the code to see which part would make it move in just horizontal direction but i keep getting errors if i don’t add the full code in. 

Is there any simple way of making a moving platform? Can’t seem to find any tutorial on it. 

Thanks.

This is done using transition.to, create your platform and this article should tell you the basics of transitions.

https://docs.coronalabs.com/api/library/transition/to.html

We actually have a couple of tutorials for you:

https://coronalabs.com/blog/2015/10/05/tutorial-physics-based-animation/

https://coronalabs.com/blog/2015/08/18/tutorial-introduction-to-transitions/

The first one has a moving platform as its example. The second one has an example of things that move back and forth like a pendulum. But instead of using transition.to() to change the rotation, using it to change the .x position would move a platform back and forth.

If you’re having trouble finding tutorials, going to Google and typing in:   corona tutorial topic, such as “corona tutorial moving platform” will bring up a list of matches in which case the first one was the first hit. It also brings up several forum threads where this has been discussed and other information from people who’ve made YouTube videos on the topic or have their own tutorial/blog posts. It’s how I went to get the URL to provide you!

Rob

This is done using transition.to, create your platform and this article should tell you the basics of transitions.

https://docs.coronalabs.com/api/library/transition/to.html

We actually have a couple of tutorials for you:

https://coronalabs.com/blog/2015/10/05/tutorial-physics-based-animation/

https://coronalabs.com/blog/2015/08/18/tutorial-introduction-to-transitions/

The first one has a moving platform as its example. The second one has an example of things that move back and forth like a pendulum. But instead of using transition.to() to change the rotation, using it to change the .x position would move a platform back and forth.

If you’re having trouble finding tutorials, going to Google and typing in:   corona tutorial topic, such as “corona tutorial moving platform” will bring up a list of matches in which case the first one was the first hit. It also brings up several forum threads where this has been discussed and other information from people who’ve made YouTube videos on the topic or have their own tutorial/blog posts. It’s how I went to get the URL to provide you!

Rob