Question: JAVA PROJECT USING JAVA Connect 4 Game Create a turn based game with a GUI, where players take turns dropping their marker into a column

JAVA PROJECT

USING JAVA

Connect 4 Game

Create a turn based game with a GUI, where players take turns dropping their marker into a column until either someone wins, or the board is full.

Display the current player on each turn.

At the end of a game display the winner and ask if they want to play again.

Board:

For Connect 4, the board should have 6 rows and 7 columns.

Turn:

A player chooses a column to drop their marker.

Win:

A win is considered 4 consecutive markers in any row, column, or diagonal.

4 consecutive markers in any row

00

01

02

03

04

05

06

10

11

12

13

14

15

16

20

21

22

23

24

25

26

30

31

32

33

34

35

36

40

41

42

43

44

45

46

50

51

52

53

54

55

56

4 consecutive markers in any column

00

01

02

03

04

05

06

10

11

12

13

14

15

16

20

21

22

23

24

25

26

30

31

32

33

34

35

36

40

41

42

43

44

45

46

50

51

52

53

54

55

56

4 consecutive markers in any upward diagonal

00

01

02

03

04

05

06

10

11

12

13

14

15

16

20

21

22

23

24

25

26

30

31

32

33

34

35

36

40

41

42

43

44

45

46

50

51

52

53

54

55

56

4 consecutive markers in any downward diagonal

00

01

02

03

04

05

06

10

11

12

13

14

15

16

20

21

22

23

24

25

26

30

31

32

33

34

35

36

40

41

42

43

44

45

46

50

51

52

53

54

55

56

INSTRUCTIONS:

On each turn, the display should show who the current player is.

The board should get filled from bottom to top just like in real life.

After a player drops their marker into the column of their choice, the program should check if he/she is a winner.

If the current player is a winner update the display label to reflect the status and ask if they want to play again.

Otherwise, the alternate player should take a turn.

If the board is full, check for a winner or a tie. Update the display label to reflect the status and ask if they want to play again.

EXTRA CREDIT:

Use image icons on the labels to display a marker when a slot is filled by a player taking a turn (5pts extra)

Create a ConnectX game so that the user can play connect4, or connect5, .. or connectX where they choose how many they would like to be in a row to be considered a win (15pts extra) - must check all diagonals

NOTE:

Below are the board game rules from Hasbro for more details if you are not familiar with the game CONNECT 4 Board game instructions

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!