Search Unity

Atypical 2D drag shapes game: Need start direction

Discussion in '2D' started by Roninisc, Mar 21, 2021.

  1. Roninisc

    Roninisc

    Joined:
    Mar 19, 2021
    Posts:
    4
    Firstly, this is not the usual drag-n-drop card game, or kids' drag into-the right-space, etc. I've been through 100 vids and tutorials without a close match for what I need.

    I am a newbie and am looking for some initial advice as to what to research and how it should be done. I'm not afraid of putting in the hours, but no clue where to start. I imagine it should be simple given correct structure.

    This is a true flat world 2d board with nothing more than circles or basic polygons which can be dragged around on the board. The circles can only be dragged in a channel or pattern specific to itself. When a circle is pressed, its pattern is displayed, then the circle may be moved in it, but not outside it. Everything is interactive with each other and many with the user.
    It gets more complex, but this is the basic gist. 2- intercept ring intercept.png 1- two threaten overlap.png

    Thank you!
     
  2. Roninisc

    Roninisc

    Joined:
    Mar 19, 2021
    Posts:
    4
  3. Roninisc

    Roninisc

    Joined:
    Mar 19, 2021
    Posts:
    4
    Im contemplating.. nav mesh, raycast, constraining the move pattern to disk...
    Any guidance appreciated.
     
  4. rarac

    rarac

    Joined:
    Feb 14, 2021
    Posts:
    570
    this sounds like its solved by simple math

    allow your shapes to be dragged but constrain the movement if its outside of the range

    for example

    if a circle should only move horizontally

    make it follow your cursor x only. Now you have a circle that only moves horizontaly

    this is your start point now apply this logic to other paths you wish
     
  5. Roninisc

    Roninisc

    Joined:
    Mar 19, 2021
    Posts:
    4
    Much thanks for your reply.

    I wish it was that simple. The move shapes are not simple l/r u/d, they may be cones, trumpet, on a diagonal, end at a certain distance, or even be disconnected. Imagine a custom nav mesh, but not based on any obstacles. (is it possible to cook a mesh then have it reman after removing obstacles?) Once a disk is moved with the players turn, the mesh/pattern stays with the disk for next turn.

    The move shapes will interact with each other and the disks also.

    It gets more complex, but that the essence.