following a line on holding down a button

Welcome to our brand new Clickteam Community Hub! We hope you will enjoy using the new features, which we will be further expanding in the coming months.

A few features including Passport are unavailable initially whilst we monitor stability of the new platform, we hope to bring these online very soon. Small issues will crop up following the import from our old system, including some message formatting, translation accuracy and other things.

Thank you for your patience whilst we've worked on this and we look forward to more exciting community developments soon!

Clickteam.
  • So say u have a set path like a bunch nodes. Like a train track and when you hold down right arrow you go down that train track and when u hold left u go back the other direction. The path is also not straight it would twist and turn at some points.


    How would you do this? Can anyone provide an example?

  • I would probably plot the nodes X and Y coordinates in a list or array object. Then when you move with the arrow keys, it will cycle to the next or previous line and read the coordinates. Depending on how you have your movement setup, you move the character there. Don't let them go to the next node until you reach the one you're already moving towards.

    For curves you would have to plot a few nodes to smooth it out.

    That's my thought process on how I would attempt it. Maybe other people will have ideas.


    Sent from my iPhone using Tapatalk

    Custom A* Pathfinding in MMF2: Please login to see this link.
    Random Tile World Generation: Please login to see this link.

  • If someone doesn't make you an example, I'll try it later tonight when I get home from work.


    Sent from my iPhone using Tapatalk

    Custom A* Pathfinding in MMF2: Please login to see this link.
    Random Tile World Generation: Please login to see this link.

  • Hopefully this example will give you an idea of what to think about.

    I used active objects as nodes so you could easily see the path, but if you actually wanted to implement this you would probably plot the coordinates and read from the list (preferably using an array object since it's faster). Therefore you wouldn't increase your object count in your frame. For example one row in your array could be a node. The Y index of the list can represent the node ID. Then you just need to record the X and Y positions of that node in separate cells on that row.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!