Code Monkey home page Code Monkey logo

connect-four-final-project's Introduction

Connect Four Final Project

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.

Project Description

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.

boardforhomepagev2

Video Demonstration(No Audio)

ConnectFourVideo.mp4

Server-Side

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.

Client-Side

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.

Website Features

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.

Getting Started

To run the Connect Four Game Project locally, follow these steps:

  1. Open the ConnectFourServer.sln on Visual Studio
  2. In the upper part of Visual Studio select 'Tools' -> 'NuGet Package Manager' -> 'Package Manager Console'.
  3. Write 'Update-Database' in the console and run.
  4. Now you can run the solution itself.
  5. A website will open on your main browser.
  6. Because the database is new on your computer you won't see any previous data, it will be empty.
  7. Register yourself.
  8. Now open the ConnectFourClient.sln on Visual Studio.
  9. 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.
  10. Run the client solution.
  11. 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).
  12. Enjoy the game.
  13. 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.

Conclusion

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.

Project Team:

  • Michael Kogan
  • Itay Ifrach

connect-four-final-project's People

Contributors

michaelk4 avatar

Stargazers

 avatar

Watchers

 avatar

connect-four-final-project's Issues

Deleting a user and all his games from the client side, after deleting them on the server side

When you delete a user from the server side it will also delete all his games from the server side database, but because of the lack of API from the server side to the client side, the client side still will have all his games in the local database, and when you register again on the website, on the client side it will appear that you will have some number of games, but on the server side you will have a whole new blank account.

Deleting a specific game is not possible

When trying to delete a game, the code logic will send the username string and a game ID, the username will reach its destination but the game ID will be 0, therefore it will not delete a certain game because all the game ids are from 1 - โˆž.

Duration Time continues to run behind the scenes of the game

When you are playing a game, and let's assume you want to pause it for the moment, you click on pause and it saves the game to the local database, and to the server. You would click 'New Game' to play a new game, and you would finish it in a few seconds/minutes,
and then you would like to finish the game that you played before, you would go to the database, and fetch that game to the board, if let's say it took you 30 seconds until you've paused the game before, now the timer won't show '00:00:30' it will show this time plus the time it took until you loaded the game, which is a problem.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.