Esempio n. 1
0
 public Node(float x, float y)
 {
     _parent = null;
     _hasParent = false;
     _coords = new Vector2D(x, y);
     _g = 0;
 }
Esempio n. 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);
 }
Esempio n. 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;
 }
Esempio n. 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;
 }