Object follow mouse path with acceleration

Get help using Construct 2

Post » Tue Aug 27, 2013 9:48 pm


I would like make a test game, about the idea similar to Draw Race 2.
Link: Draw Race 2 Video
I already found the basics from this forum post with follow mouse path:
Forum Link

I use for start ramones's rocketFollowPath_fixed.capx (r103.2)

However, I would like to ask from your opinion, how should I create a "path follow" behavior with acceleration based on the mouse speed movement.
I had an idea with comparing global variables which stores mouse.X and Y values from in every X seconds?
Like distance between actual Mouse.X and past Mouse.X divided by time, but how should I add to change the path?

I would like to achieve that, if I make a fast 90 degree change, then the object shouldn't follow the path that strict. I hope someone has a good idea to achieve this.

Have a great day!gaborkiss2013-08-27 21:52:15
Posts: 4
Reputation: 1,108

Post » Fri Aug 30, 2013 12:25 pm

Hy again!

I would like to trace the movement of the mouse within a criteria (like when the left mouse is down).

like: Frame 1. X Y, Frame 2. X Y etc..

Or which option do I have, if I want to compare the distance travelled by the mouse between time 1 and time 2?
I hope someone has a good solution for this.

Posts: 4
Reputation: 1,108

Post » Fri Aug 30, 2013 12:49 pm

Something like this?

create 2 variables: OldMouseX and OldMouseY

on mouse left button down
every x seconds
set object speed to distance(mouse.x,mouse.y,OldMouseX,OldMouseY)
set OldMouseX to mouse.x
set OldMouseY to mouse.y

You have to set the speed before setting OldMouseX and OldMouseY.
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
Posts: 6,160
Reputation: 19,775

Post » Fri Aug 30, 2013 5:13 pm

Thank you LittleStain for the reply and solution!gaborkiss2013-09-02 16:30:20
Posts: 4
Reputation: 1,108

Return to How do I....?

Who is online

Users browsing this forum: Invidel and 2 guests