Random motion of an object. Help.

0 favourites
  • 5 posts
From the Asset Store
Game with complete Source-Code (Construct 3 / .c3p) + HTML5 Exported.
  • I would like to add the option, That an object will move by itself, without anyone pressing any buttons, in various directions, right, left, up and down the screen.

    Is there any plugin That Allows this?

    Thank you very much.

  • This is precisely what the sine behavior is for..well, that and a lot of other things that require smooth variation. You can add multiple sine behaviors to an object to have it move horizontally, vertically, scale, transparency, rotation, etc.

  • I think you can also do this with bullet behavior as bullet behavior also support directions. I think you can also the random direction movement with time , like every Random time there will be a Random direction picked by your object. Not check , it is just an idea you have to gave it a try.<img src="smileys/smiley1.gif" border="0" align="middle" /> Hope that helps .

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • What I want to do, Is that an object, for example (an enemy) The only move to the right, left, up, or down, Simultaneously, anyone without press any key. And every time the enemy, is directed right, play an animation in the sprite of the enemy walking to the right, and do the same, When you go up, down or to the left.

    Took about 3 hours and not gotten anything yet .. Any help?

  • Sine behavior as someone already mentioned.

    Save the current x and y of your object into an instance variable and before that compare if those instance variables are smaller or larger than the current x and y and then change the animation accordingly.

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