Drag object along a track HELP!!

This forum is currently in read-only mode.
From the Asset Store
Game with complete Source-Code (Construct 3 / .c3p) + HTML5 Exported.
  • Hello everyone, Im new to the community and I would very much appreciate your help with this

    I want to have a sprite (a simple square), over a path or track ,and be able to use the mouse to hold and slide the box to the desired location on said track, when I release the mouse button it would stay in place.

    I would have many such boxes and tracks on screen, being able to slide just one at a time...

    What I am trying to create is something like this image:

    http://www.okw.co.uk/products/okw/slide ... LKNB_A.jpg

    The main difference that the tracks in this one are simple lines and I am thinking of having tracks that have shapes (simple shapes, an 'L' shape, a 'T' shape or a square for example).

    Hope you have an insight as to how I could do this...I thank you in advance for your help

    -Fade

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Mouse is over object

    Mouse button is down

    -object set x to mouse x

    or

    -object set y to mouse y

  • What newt said. And to give you a little rough example that works with shapes like you wanted:

    Slider Fun

    This file needs at least Construct version 0.99.7

    Tracks can be horizontal or vertical which is indicated by a private variable 'orientation' which you have to set accordingly to "ver" or "hor". Also the sliders have a PV which indicates if they're being used atm. The events should explain themselves for the most part (I hope). If anything remains unclear feel free to ask.

    Oh and welcome to the community Fade!

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