Need some help with sprite sinusoidal movement

0 favourites
  • 2 posts
From the Asset Store
Game with complete Source-Code (Construct 3 / .c3p) + HTML5 Exported.
  • 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.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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. is more like a begging

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