Mire Engine




Test Compiled Example Game



  1. PathFinding

    Tags
    News
    By Thejuster il 10 Sep. 2018
    +1   -1    0 Comments   12 Views
    .
    A new Algorithm of pathfinding are in programming.
    In this case, the algorithm it's similare work of editor logic.

    For example a grid movement algorithm

    math-20180907.png.0da6a742359022264b7bed1d3e6d41b8

    a = Number of block
    n = Index
    X = Size of block

    in parallel cycle in separate thread.

    a very small test of working

    CODICE
    if (StartPoint.X > EndPoint.X)
               {
                   Vector2 newPos = new Vector2(StartPoint.X, StartPoint.Y);

                   var c = m.GlobalMap.Where(x => (x.vector2.X == StartPoint.X - 32) && (x.vector2.Y == StartPoint.Y)).FirstOrDefault();

                   if (c.type == Map.TypeAction.Walkable)
                   {
                       StartPoint = c.vector2;
                   }
                   else
                   {
                       c = m.GlobalMap.Where(x => (x.vector2.X == StartPoint.X) && (x.vector2.Y == StartPoint.Y - 32)).FirstOrDefault();
                       if (c.type == Map.TypeAction.Walkable)
                       {
                           StartPoint = c.vector2;
                       }
                   }
               }


    Actually code are in development but there is a good percentage of success :)
    I hope to be able to finish this plug-in as soon.
    Stay connected for more news.
    Last Post by Thejuster il 10 Sep. 2018
    .
 
Skin by Frankie-ITA