How do I make an object move?

0 favourites
  • 3 posts
From the Asset Store
Hand-painted tiles, objects, animated objects, and background to build a colorful Mayan civilization environment.
  • I was wondering how to make a ball move in a horizontal line at a certain speed and a certain distance. Also i would like it to keep going back and forth for that certain distance.If anyone knows how to do this please tell me! Thank you

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I think Ashley had a tutorial about this part. It explained that principle where you can make an enemy sort of "patrol" and I think that is what you are after. It is the platformer tutorial.

    Essentially, however, what you do is create 2 sprites (just any colored squares would work) and place them exactly at the two points where your ball should move back and forth just like the below:

    * o * (the 2 square sprites would be the * and the ball is the o)

    Next you would add the bullet behavior to the ball (or the 8 direction movement and restrict it to 2 directions).

    You would want a condition then checking if the ball collides with one of the 2 sprites and add an action to reverse the direction of movement of the ball.

    I believe that should solve the problem.

  • The easiest way and without any conditions or actions would be the sine behavior added to the object , the manual will explain it quite well.

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