public override bool IsDestinationAllowed(Point node, HackGameBoard board) { //if location is a node if (board.InBoard(node) && board.board[node.Y, node.X].type == HackGameBoardElementBaseType.HackGameBoardElementBaseType_Node && board.IsNodeAlive(board, node)) { return true; } return false; }
private void UpdateActiveState(GameTime time, HackGameBoard board, HackNodeGameBoardMedia drawing) { switch (currentAIState) { case HackGameAgent_AI_State.HackGameAgent_AI_State_Wander: Wander_Update(time, board); break; } if (StartPing_Update) { //be sure we're in a node. if (board.InBoard(getCurrentBoardLocation()) && board.GetElementAtPoint(getCurrentBoardLocation()).type == HackGameBoardElementBaseType.HackGameBoardElementBaseType_Node) { //do some other stuff here. StartPing_Draw = true; StartPing_Update = false; } } }
private void UpdateActiveState(GameTime time, HackGameBoard board, HackNodeGameBoardMedia drawing) { if (StartPing_Update) { //be sure we're in a node. if (board.InBoard(getCurrentBoardLocation()) && board.GetElementAtPoint(getCurrentBoardLocation()).type == HackGameBoardElementBaseType.HackGameBoardElementBaseType_Node) { //do some other stuff here. board.AddBackgroundTextStandard(new StringBuilder("HACKNODE PING #0198"), 0); board.AddBackgroundTextStandard(new StringBuilder("HACKNODE OK"), 0.75f); StartPing_Draw = true; StartPing_Update = false; } } if (this.getMovementDirection() != MovementDirection.MovementDirection_None) { setTtoDestination(getTtoDestination() + movementSpeed * (float)time.ElapsedGameTime.TotalSeconds * board.GetSpeedUpFactor()); } else if (nextBoardElementDestinations.Count > 0) { setDestinationBoardLocation(nextBoardElementDestinations.Pop(), board); } if (isHacking) { drawing.binaryOneFountain_emitter.Update(time, lastDrawPos + new Vector2(41.0f, 41.0f)); drawing.binaryZeroFountain_emitter.Update(time, lastDrawPos + new Vector2(41.0f, 41.0f)); } }