protected override void Update(TimeSpan gameTime) { if (!started) { started = true; UIBehavior ui = Scene.EntityManager.Find("camera2D").FindComponent <UIBehavior>(); Entity p = ui.CreateToTile("Person", 3, 3); List <LayerTile> tiles = new List <LayerTile>(); tiles.Add(Map.map.GetTileByMapCoordinates(3, 3)); tiles.Add(Map.map.GetTileByMapCoordinates(2, 3)); tiles.Add(Map.map.GetTileByMapCoordinates(2, 2)); tiles.Add(Map.map.GetTileByMapCoordinates(2, 1)); p.FindComponent <MovementBehavior>().SetPath(tiles); p = ui.CreateToTile("Trap", 2, 2); ui.playerButtons[1].IsChecked = true; p = ui.CreateToTile("Trap", 2, 3); } }
protected override void Update(TimeSpan gameTime) { if (!started) { started = true; UIBehavior ui = UIBehavior.ui; Entity p = ui.CreateToTile("Person", 3, 3); List <LayerTile> tiles = new List <LayerTile>(); tiles.Add(Map.map.GetTileByMapCoordinates(3, 3)); tiles.Add(Map.map.GetTileByMapCoordinates(2, 3)); tiles.Add(Map.map.GetTileByMapCoordinates(2, 2)); tiles.Add(Map.map.GetTileByMapCoordinates(2, 1)); tiles.Add(Map.map.GetTileByMapCoordinates(3, 1)); p.FindComponent <MovementBehavior>().SetPath(tiles); p = ui.CreateToTile("FakeTree", 2, 2); ui.playerButtons[1].IsChecked = true; p = ui.CreateToTile("FakeTree", 1, 2); p = ui.CreateToTile("Person", 1, 1); tiles = new List <LayerTile>(); tiles.Add(Map.map.GetTileByMapCoordinates(1, 1)); tiles.Add(Map.map.GetTileByMapCoordinates(1, 2)); tiles.Add(Map.map.GetTileByMapCoordinates(2, 2)); tiles.Add(Map.map.GetTileByMapCoordinates(2, 1)); tiles.Add(Map.map.GetTileByMapCoordinates(2, 0)); tiles.Add(Map.map.GetTileByMapCoordinates(1, 0)); tiles.Add(Map.map.GetTileByMapCoordinates(0, 0)); tiles.Add(Map.map.GetTileByMapCoordinates(0, 1)); p.FindComponent <MovementBehavior>().SetPath(tiles); } }