Exemple #1
0
 public Node(float x, float y)
 {
     _parent = null;
     _hasParent = false;
     _coords = new Vector2D(x, y);
     _g = 0;
 }
Exemple #2
0
 public Node(Node parent, float x, float y, int heuristic)
 {
     _parent = parent;
     _hasParent = true;
     _g = _parent._g + 10;
     _heuristic = heuristic;
     _f = _g + _heuristic;
     _coords = new Vector2D(x, y);
 }
Exemple #3
0
 public NPC(Vector2D start, Vector2D end, int[,] grid)
 {
     _start = start;
     _end = end;
     _currentCoord = start;
     _currentPosition.x = (float)(start.x * 50 + 12.5);
     _currentPosition.y = (float)(start.y * 50 + 12.5);
     NPCGrid = grid;
 }
Exemple #4
0
 public Rectangle Draw(Vector2D mapOffset)
 {
     int x = (int)_currentPosition.x + (int)mapOffset.x;
     int y = (int)_currentPosition.y + (int)mapOffset.y;
     _icon = new Rectangle(x, y, 25, 25);
     return _icon;
 }