Custom movement scroll, maybe?

0 favourites
  • 3 posts
From the Asset Store
All popular touch mechanics - scrolling, zooming, swiping
  • I am playing around with custom movement trying to get a block to move a certain set distance distance, say 200 pixels on a mouse press and then stop when it has done it.

    I don't want that distance covered instantly on the mouse press, but for the block to move smoothly at a pre defined speed.(it can accelerate/decelerate but needs to cover a set distance)

    However I also want the speed the block covers that distance to increase if i press the mouse button again before the blocks movement has finished, so if i press it twice then the block will have to move 400 pixels but the speed it covers those pixels will increase, and will increase again if i press the mouse button even sooner for a 3rd time. If i slow the pressing down then the speed drops.

    so I can have 2,3,4 or more blocks moving 200 pixels at a time (grid like) across the screen like a train and carriage on a mouse press, each time i click the mouse they all move again, speeding up or slowing down depending on the speed of the clicking.

    Would anyone have an idea of how to approach this? I have been trying a few ways but haven't got anything I am happy with yet.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • With distance, you would probably also need to determine the direction... will it be 'like a train' and follow a track (or path) ?

    If it is going to be like a train, you could always have the locomotive and then pin your cars, one to the other forming a chain for your train.

    Then have your train move by xx pixels initially, say 2, then click and it moves by 4, then click and it moves by 6... you could set up a variable for this and use whichever mouse click (or touch) event that would suit your needs... meaning, can the player click anywhere, on a button or throttle control or click directly on the locomotive...

    First, get your locomotive moving like you want and then add the cars... At least that is how I would approach it... One step at a time...

    There are several ways this could be approached, all depending on your wants and need but maybe this will help a little...

    Try searching thru the tutorials using different keywords... You probably won't find one to give you exactly what you need but you should be able to pick up enough bits and pieces to get your train moving in the right direction...

  • Thanks, giving it a bit more thought

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