How do I make a sprite's instances move different ways?

0 favourites
  • 3 posts
From the Asset Store
Units do not overlap each other and use different ways if there are several free ways.
  • Hello all,

    I have this dumb problem that I can't solve. It must be easy but I can't see it

    . I have a box (Sprite), of which I made 3 instances.

    . I want to have the box move up when I click on it.

    . The trick is I want the boxes to move at different heights depending on which one I click.

    Is it possible to do that (with UID or something else), or do I have to clone my sprite and create different events (for three different objects as opposed to three instances)?

    I'm very new at all this, tried to look at examples and searched the forums, but didn't find much or nothing that was clear for me...

    Thanks in advance for any sort of help!

    Piotr

  • Many many ways to do this, but a simple first solution would be to give the sprites an instance variable (let's call it movepixels) and set it to the amount of pixels you'd want to move it..

    then on clicked - move sprite.movepixels pixels

    now it should be different for each box (if you set the variable to different numbers, that is)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Man I feel so dumb.

    That totally works. Thanks!

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