My goal here is to give you some ideas, and a smidgen of code, that I hope will help you write the game yourself.
A quick sketch of strategies for monitoring the mouse movement during the game. I'll assume:
0. you define the variance threshold the determines how far the mouse can vary on the horizontal and vertical axes when the game is being played. in a variable of type int: 'threshold
1. you'll record the initial mouse down x,y position in variables mdX, and mdY, and the final mouse-position on mouse-up in muX, and muY.
1.a. you'll create a boolean flag to indicate if the current game is being played vertically, or horizontally: isUpDown
1.b. you'll create a boolean flag to indicate if the current game is over: isGameOver
1.c. you'll create a boolean flag to indicate if mouse is up: isMouseUp
1.d. you'll record the DisplayRectangle of the PictureBox in the variable 'pictureRectangle
2. you'll write an end of game function called 'gameOver(boolean completionState that gets called whenever the game ends, and, if 'completionState is true, you'll do what you need to do figure out if the user won; if 'completionState is false, the game is lost.
3. I assume there are three ways the user can lose the game:
a. moving the mouse outside the PictureBox while the Mouse is down and the game is in play.
b. moving the mouse too far right or left in the horizontal axis when the game is being played down-up, or up-down
c. moving the mouse too far up or down in the vertical axis when the game is being played left-right, or right, left
private void pictureBox1_MouseMove(object sender, MouseEventArgs e)
{
if (isMouseUp || isGameOver) return;
if (! pictureRectangle.Contains(e.Location)) gameOver(false);
if (isUpDown)
{
if (Math.Abs(mdX - e.X) > threshold) gameOver(false);
}
else
{
}
}
Here's a quick (again, deliberately incomplete) sketch of how you might structure the 'gameOver function:
private void gameOver(bool completionState)
{
isGameComplete = true;
isGameOver = true;
bool isAWin = false;
if (completionState)
{
}
if(isAWin)
{
}
else
{
}
}