public void createShadowCreature(int x, int y) { LivingGameEntity shadowCreature = new LivingGameEntity("ShadowCreature"); shadowCreature.AddCustomStyling("shadowCreature"); shadowCreature.SetParentStage(Stage.CurrentStage); Stage.CurrentStage.AddLivingGameEntity(shadowCreature); shadowCreature.SetPosition(x, y); ArtificialIntelligence creatureAI = new ArtificialIntelligence(); creatureAI.SetMovementThoughtPattern(customCreatureThoughtPattern); shadowCreature.SetAI(creatureAI); }
//test function to make a new tower... public void placeATower(GuiEvent gEvent) { //hide the collision map gui layer Stage.CurrentStage.HideCollisionMap(); // Make sure we can place a tower there. if (checkTowerPlacement(gEvent) == false) { // Make a noise. return; } // Need to add a check for financial ability as well ... // But maybe on the tower menu instead. Tile clickedTile = gEvent.clickedTiles[0]; // Decrement the player's currency changePlayerCurrency(-33); towerToPlace = LivingGameEntity.CloneByName(desiredTowerName); towerToPlace.SetParentStage(Stage.CurrentStage); towerToPlace.SetPosition(clickedTile.GetPosition().x, clickedTile.GetPosition().y); towerToPlace.Faction = playerFaction; Stage.CurrentStage.AddLivingGameEntity(towerToPlace); //deselect the selected tower in the gui menu GuiLayer towerLayer = GuiLayer.GetLayerByName("TowerMenu"); //towerLayer.SelectItem("By putting this text here, everything will be deselected, but nothing will be selected.", -1); // Destroy the notification. placeTower.Destroy(); // After the tower is placed, re-calculate pathing for the stage. // If there is only one path enemies can take, mark the crucial point(s) as walkable but unbuildable. }