Code Monkey home page Code Monkey logo

sequence-game's Introduction

Sequence Board Game

Overview

This project is a multiplayer Sequence board game built using React and WebSockets, designed for four players (two teams of two). The game includes dynamic board generation, real-time gameplay, and comprehensive game state management to ensure a seamless user experience.

Features

  • Multiplayer Functionality: Supports four players in real-time, with two teams competing to create a sequence of five chips.
  • Dynamic Board Generation: The Sequence board is dynamically generated using React components, allowing for flexible gameplay.
  • Turn-Based Gameplay: Players take turns to play cards, with real-time updates ensuring all players see the latest game state.
  • Card Management: Each player receives a set of six cards from a shuffled deck, with the ability to play valid moves or use jacks to place chips strategically.
  • Winning Condition: The game detects and announces the winning team once a sequence of five chips is achieved, or declares a draw if no winner is determined after 12 moves.

Installation

  1. Clone the repository:

    git clone https://github.com/yourusername/sequence-board-game.git
  2. Navigate to the project directory:

    cd sequence-board-game
  3. Install the dependencies:

    npm install
  4. Start the server:

    node server.js
  5. Open client.html in your browser to start the game.

How to Play

  1. Four players join the game, and each is assigned a color (blue or green).
  2. Players take turns to place chips on the board by playing cards from their hand.
  3. The goal is to form a sequence of five chips in a row, column, or diagonally.
  4. The first team to achieve this wins the game, and the game state is updated for all players in real-time.

Project Structure

  • client.html: The main HTML file that hosts the game.
  • client.js: Contains the client-side logic, including state management and WebSocket communication.
  • server.js: Manages the WebSocket server

sequence-game's People

Contributors

umarsaeedcheema avatar

Watchers

 avatar

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.