Random movement

  • how can I do that an object has random movement?

    For example, that one object moves horizontally, other vertically...

    And how can I do that the object bounce diagonally when collision with the limits of the room?

    (I'm spanish, sorry if I write bad)

    Thanks for your answers <img src="smileys/smiley1.gif" border="0" align="middle" />

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • It would be nice if you were a little more specific. Could you give us some images to show what you want?

  • Yes:

    dl.dropbox.com/u/55341396/example.png

    (I don't know if I write correctly in the paint because I only know English to study at the institute)

  • Do you want every instance of the same object to move differently or that every object has its own movement?

    EDIT:

    So if you want the objects to maintain their speed while "bouncing" you just need to edit their Y movement when colliding with top and bottom boundaries and their X movement if they collide with left and right boundaries.

    So lets say one object is moving 100,-100 pixels per second. When it collides with the top boundary just make it move at 100,100.

  • I want every instance of the same object move differently.

    The problem is that I am totally new to the program and do not know just how to do things.

    What actions / events I have to put in the object? I do not know or do the random motion when the game starts, no bounce ...

  • Why not give them the bullet behavior, then enable bouncing off solids?

  • Thanks for your answer. I managed to make the object rebound, but I do not know how to bounce diagonally. What event or action should I set?

    And how do I make an object to collide with another one appears randomly in the room?

    Sorry for the inconvenience of my little knowledge

  • dl.dropbox.com/u/14492504/construct2examples/horvertbox_randombounceball.capx

    Here is and example I did. Dont know if I understod you correctly but it show you how to set horizontal or vertical movement on a sprite with bullet behaviour. And the how to set a random direction at the different direction when a bullet behaviour collide with the layout border. You can of course change these values to have them at a specific angle.

  • Oh, is great!! <img src="smileys/smiley20.gif" border="0" align="middle" /> ��thank you very much!!

    Also thanks to others for trying to help me :)

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