How to refactor and improve this XNA mouse input code?
- by Andrew Price
Currently I have something like this:
public bool IsLeftMouseButtonDown()
{
return currentMouseState.LeftButton == ButtonState.Pressed && previousMouseSate.LeftButton == ButtonState.Pressed;
}
public bool IsLeftMouseButtonPressed()
{
return currentMouseState.LeftButton == ButtonState.Pressed && previousMouseSate.LeftButton…