This README document provides an overview of the Connect Four Game Project that utilizes ASP.NET for the website server-side and Windows Forms for the client-side game GUI.
This project aims to create an interactive and engaging gaming experience where users can play the classic Connect Four game through a user-friendly Windows Forms GUI. The project is divided into two main components: The Server-side and the Client-side.
ConnectFourVideo.mp4
The project's server-side is implemented using ASP.NET Core Web Application, which provides a robust framework for handling web applications and APIs. The server is responsible for:
- Managing user accounts: When a client wants to log in to the game he enters his username the client-side asks the server if the user exists in the server's database.
- Game data storage: Basic game data is stored on the server to keep track of ongoing games.
- User statistics: The server updates the user's statistics when a game is completed, incrementing the total number of games played.
The client-side of the project is implemented using Windows Forms, providing a graphical user interface for players to interact with the game. The client-side GUI offers the following features:
- Play: Users can make moves in the Connect Four game by selecting columns on the game board.
- Replay: Users have the ability to replay previously played games.
- Resume: If a game is paused, users can resume it from where they left off.
- Restart: Users can restart the current game without saving the previous state.
- New Game: Users can start a new game from scratch.
- View Game History: Users can view their previous game history stored on the client-side database.
The website component of the project provides additional functionalities accessible through a web interface:
- Edit users: Users can edit their information.
- Delete User: You have the option to delete your user, including all your game data.
- View User Details: Detailed user information, including their game statistics, can be viewed.
- View Game Details: Information about individual games, such as outcome and duration, can be accessed.
- Statistics Page: The website offers a statistics page featuring various queries and views to showcase data from the user and game tables.
To run the Connect Four Game Project locally, follow these steps:
- Open the ConnectFourServer.sln on Visual Studio
- In the upper part of Visual Studio select 'Tools' -> 'NuGet Package Manager' -> 'Package Manager Console'.
- Write 'Update-Database' in the console and run.
- Now you can run the solution itself.
- A website will open on your main browser.
- Because the database is new on your computer you won't see any previous data, it will be empty.
- Register yourself.
- Now open the ConnectFourClient.sln on Visual Studio.
- In both Program.cs and DatabaseBox.cs(right mouse click -> 'view code') change the path of the 'connStr' to the path to the 'Database.mdf' file in the 'ConnectFourClient' Folder.
- Run the client solution.
- Enter your username and login, if you didn't enter a username before you can press the sign-up button and it will take you to the register page(only if the server side is running).
- Enjoy the game.
- If you want to save your game to the database you can press either Pause/New game/ End game. If you finish the game and you Won/Lost or Draw the game won't be saved to the database automatically.
The Connect Four Game Project, completed as part of a .NET course, demonstrates the implementation of the classic game. The project showcases the use of ASP.NET for server-side components and Windows Forms for the client-side interface. The integration of user accounts, game storage, and statistics tracking enhances the user experience and provides a well-rounded gaming platform.
- Michael Kogan
- Itay Ifrach