how do i get somthing to follow a line

0 favourites
  • 5 posts
From the Asset Store
solution for games like "fruit ninja" and drawing applications
  • like a tower defence game how do i get it to stay on the tracks im not very good with the sline thing

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Can you give us some details? The more the better. Best would be to upload your example and describe exactly how you want it to behave.

  • What you want is a spline path generation and follow on spline path algorithm. A recommended spline type is the Catmul-Rom Spline (hermite type). Though i don't have the slightest idea how to implement it in construct :( . If C2 had support on editor of path creation it would be quite easy. One more thing to todo-list i fear

  • nah! there's a simple way, just use waypoints

    unless you want to make some funky curvy path you will probably just have straight paths and turns.

    So you just have to now when and where to turn.

    You place some sprites with an instance variable called direction

    Sprite.direction equal either 0,90,180 or -90

    you probably have an entry point for your ennemies and a starting direction, you make them move in this direction and when they overlap the sprite you just change the angle of movement to the angle of Sprite.direction.

  • Yeah for simple paths waypoints is sufficient. It'll depend on the level of complexity that jos101 wants. Most types of tower defence games follow rectangular paths so way points would be enough. But for it wouldn't work for a autorama type racing game for example.

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