How Does the Arduino Connect Four Game Work? Each player has a colored dot. Depending on the movement of the joystick, the values of the axis movements (X or Y) are compared and the direction of the dot on the matrix is determined. The player can move the dot up and down or left and right. Once a decision is made, the player presses down on the joystick. When it is pressed, the game switches to the next player and opponent's dot starts blinking. At each stage, the program determines if the movement of the dot is legal or not. For example, a dot cannot be moved outside the matrix or occupy the opponent's space. It also determines when the game has been won. The game is won when any player puts four dots in a line. This line can be vertical, horizontal or diagonal.