Custom movement scroll, maybe?

Get help using Construct 2

Post » Mon Nov 03, 2014 4:12 pm

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.
Some games: https://play.google.com/store/search?q= ... s&hl=en_GB Feel free to show the panda some support, he would appreciate it :)
B
19
S
5
G
1
Posts: 155
Reputation: 1,619

Post » Mon Nov 03, 2014 5:46 pm

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...
B
11
S
2
Posts: 46
Reputation: 739

Post » Tue Nov 04, 2014 10:06 am

Thanks, giving it a bit more thought :)
Some games: https://play.google.com/store/search?q= ... s&hl=en_GB Feel free to show the panda some support, he would appreciate it :)
B
19
S
5
G
1
Posts: 155
Reputation: 1,619


Return to How do I....?

Who is online

Users browsing this forum: apalm1341, blissfulwizard and 15 guests