Circular Maze Path Help

  • Hi everyone,

    I am in need of some advice on the following screenshot which I hope explains what I am trying to do.

    <img src="http://dl.dropbox.com/u/31121080/PATH_ISSUE.png" border="0" />

    I have the rotation working fine, and I can get the straight segments easily done. But what I don't know how to do is:

    • chose clockwise or counterclockwise (e.g. 7-8 should have gone the other way in the diagram)
    • stop rotating and go straight

    Please note, I only have coordinates to the odd numbered X,Y positions.

    Could someone please lend a hand on this issue for me?

    Thanks. :)

  • "I am in need of some advice on the following screenshot which I hope explains what I am trying to do."

    Not really. Is it somebody trying to find a path through a maze? Or is the whole thing rotating?

    But I'll try to help. Could you use "distance" to decide which way to rotate? Also when to stop, when you are at the closest distance along the circular path.

    scirra.com/manual/126/system-expressions

    distance(x1, y1, x2, y2) Calculate distance between to points

  • You only have coordinates to the odd-numbered positions? How do you know where to place 8 then? And for the previous arcs, how do you decide whether to go clockwise or counterclockwise from the previous chord? Are these Cartesian coordinates or polar coordinates?

    I think a bit more explanation or a caps would help!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks for the replies!

    Sorry for not being more specific the first time.

    The object moving along the path is an enemy AI sprite.

    The path is the inside of a tubular tunnel (center is the vanishing point). So as the object moves towards an edge it gets bigger etc. So the thought process of travelling in a circular motion is so I can get the enemy to move from 1 side of the tunnel to the other without crossing the vanishing point (that looks weird). In total I have randomly placed 10 waypoints for each enemy wave and they should repeat until they are destroyed and so on.

    The even positions in the diagram are easily calculated by going to the odd point and drawing a line to the vanishing point, where the circle and the line intersect gives you those coordinates.

    I have placed a link to the capx below, but it's the full thing (warts and all). It also uses the SpriteFont plugin.

    The scripts to look at are on the GAME sheet within the ENEMY_AI and WAYPOINTS groups.

    Please let me know if there is anything in there that needs clarification.

    dl.dropbox.com/u/31121080/WHI_V0.1_AI_Movement_Failure.capx

    Thanks, Brett

  • Hey Brett, I wasn't able to download the plugin and I couldn't figure it out from looking at the xml of your event sheet. Sorry! I hope someone else will be able to help you out.

  • No worries, thanks for the time you spent on it. :)

  • Thanks to anyone who looked at this I've managed design something that works nicely (not exactly as I envisaged but a good effect non the less).

    I'm removing the capx from Dropbox now. ;)

    Cheers, Brett

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