Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)
Paste
Pasted as C# by snwstnt ( 17 years ago )
public static class Input
{
public static void UpdateInput(Game game)
{
MouseState mouseAttributes = Mouse.GetState();
IsMouseVisible = true;
mousePosition = new Vector2(mouseAttributes.X, mouseAttributes.Y);
if (Keyboard.GetState().IsKeyDown(Keys.Escape)) this.Exit();
if (mouseAttributes.MiddleButton == ButtonState.Pressed) drawShape = true;
if (mouseAttributes.RightButton == ButtonState.Pressed)
{
points = new Vector2[100];
index = -1;
drawShape = false;
drawCentroid = false;
drawWarning = false;
}
if (mouseAttributes.LeftButton == ButtonState.Pressed && !drawShape && index < 99)
{
if (index == -1)
{
index++;
points[index] = mousePosition;
}
else if (points[index] != mousePosition)
{
index++;
points[index] = mousePosition;
}
}
}
}
Revise this Paste