Need some help with sprite sinusoidal movement

Get help using Construct 2

Post » Wed May 14, 2014 2:02 pm

There are 9 sprite instances called "points" with sine behavior (all set to vertical with different Period offset) to create some sort of wave movement.
Sprite is created somewhere on the right - outside the layout, and always moves to the left.

What I'm trying to do is to make that Sprite follow a path made by "points" with sine behavior, something like sinusoidal movement along path.
Sprite origin should slide along, above the line made by "points" but maintaining that smooth curved line position. Also I want to control "points" Sine behavior Magnitude and Period and Sprite speed at runtime so transitions should be as smooth as possible.

Been stuck on this for last 3 day so any help will be very much appreciated.


btw. Canvas plugin is there to only visualize what kind of path Sprite should follow.
You do not have the required permissions to view the files attached to this post.
ImageImageImageImage
B
158
S
67
G
43
Posts: 2,603
Reputation: 36,003

Post » Thu May 15, 2014 2:17 am

Sorry for double post, but I cannot edit my first post :/

I've modified a file a bit, cause I'm trying a different approach. Instead of moving objects/enemies I'm moving Points which let me more easier spawn and actually pin objects to "points" and move them correctly.

My issue is still the same unfortunately but on the other side. On the left there a sprite (future player character) and it should move vertically only keeping shape of the wave.

And still can't find a solution for that. Closest to what I want is current setup Sprite: Set Y to points(3).Y but there's a little jump where points are destroyed and new one created. Which kind of break the flow of the sine movement.

One more thing. Points must preserve their IID, so one one the left must have IID=0 and one on the right IID = 9 - because I'm using canvas to draw some vertical lines between them and other stuff - and there's no way to use variables to control lines and curves (at least I did not found any :/) in Canvas plugin.

Once again, any help will be very much appreciated. ...now is more like a begging :D
You do not have the required permissions to view the files attached to this post.
ImageImageImageImage
B
158
S
67
G
43
Posts: 2,603
Reputation: 36,003


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 8 guests