public bool ClickCheck() { if (ClickBox.Contains(Mouse.GetState().Position) && InputEngine.IsMouseLeftClick()) { //Debug.WriteLine("ClickCheck Tile: " + IsWalkable); return(true); } return(false); }
public bool ClickCheck() { if (InputEngine.IsMouseLeftClick() && ClickBox.Contains(Mouse.GetState().Position) && !HasMoved && IsActive) { Debug.WriteLine("Clicked"); return(true); } else { return(false); } }
public bool ClickCheck() { if (ClickBox.Contains(InputEngine.MousePosition) && InputEngine.IsMouseLeftClick()) { //Debug.WriteLine("TRUE"); return(true); } else { //Debug.WriteLine("FALSE"); return(false); } }
//Overrides public override void Update(GameTime gameTime) { ClickBox = CollisionField; if (Health <= 0) //Checks if character is dead { Visible = false; IsDead = true; } if (IsActive) { if (IsSelected) { for (int i = MovementRange; i > 0; i--) { grid.CheckMoves(gridCell, i, teamNumber); } grid.CheckAttack(gridCell, MovementRange + AttackRange); //IsSelected = !IsSelected; } if (IsSelected && InputEngine.IsMouseLeftClick()) //Executes movement script { IsSelected = false; Move(grid); Debug.WriteLine("Move"); grid.ResetWalkable(); } else if (!IsSelected && ClickCheck()) { IsSelected = true; Debug.WriteLine("Selected"); } } gridCell = new int[] { (int)Position.X / 64, (int)Position.Y / 64 }; base.Update(gameTime); }