Slide Y position and get it BACK to original?

0 favourites
  • 6 posts
From the Asset Store
Helping streamers give their viewers more excitement.
  • Hello All,

    I want to make when the mouse cursor is over a sprite on a specific animation.

    to SLIDE 10 pixels up on the Y axis.

    and when the mouse is NOT over it, to slide back to it's original place, wherever the sprite is on the screen so it will be dynamic and not based on the screen resolution.

    Ideas? example files? tutorial? any step-by-step will be very helpful as I'm still learning.

    Thanks ahead! :)

    Tagged:

  • drive.google.com/file/d/1iEbadOvnUgqd_ulvRGhOVyGg7KEYS3m0/view

    The disabled events should do the same as the events which are under this block. But it doesn't work correctly. Don't know if I done something wrong or if there is a bug with OR and MouseOver. So it's now a little more complicated.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hello,

    I've done this example : Create Sprite, save original_y, On Mouse Over Sprite goes up, else he goes original_y. Enjoy!

    dropbox.com/s/n4zrybzs8hbnmjl/Mouse_over.c3p

    You can add a condition : When Sprite.Animation is X, On Mouse Over

  • Thank you both for the example files I will explore them and see what's best for my use!

    I did try the tween before but it act very weird, and since it's based on time I hope it won't act different on SLOW vs FAST machines... since I need it to move exactly X amount of pixels, no matter what the machine speed is.

    EDIT:

    I'm thinking about simulating Tile Movement since it's based on pixels, but I'll have to experiment and see if it works, could be a nice direction since it's already smooth, what do you think?

    Any extra advice related or examples are always welcome, thanks ahead! :)

  • Tween use dt, so it's entirely scalable…

    You can also use Tween for a value, and not for a move, so you can control more precisely…

  • Tween use dt, so it's entirely scalable…

    You can also use Tween for a value, and not for a move, so you can control more precisely…

    That's great! I didn't know it uses dt so I'm safe with accurate :)

    I'll probably use it if I'll have no choice, but I'm curious about the Tile Movement.

    I'm trying to do this with simulating UP Tile Movement for 10 pixels but can't really get this to work, not sure why.

    I did use "when over object" >> simulate UP movement, and I did make sure the behavior is enabled by default. but it's not affecting the sprite.. nothing happens when the mouse is over the sprite.

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