Giter Site home page Giter Site logo

ibra-kdbra / chessboard-three.js Goto Github PK

View Code? Open in Web Editor NEW
2.0 3.0 0.0 1.93 MB

Chessboard 3d-2d game

Home Page: https://ibra-kdbra.github.io/Chessboard-three.js/

HTML 0.86% CSS 1.95% JavaScript 97.19%
ai algorithms blender css-animations css3 html5 javascript threejs

chessboard-three.js's Introduction

Three.js Chess Game

This is a chess game made using the Three.js library and JavaScript. The game includes a 3D chessboard with realistic lighting and materials, move validation, and support for castling and en passant. The game also includes an AI opponent using the Stockfish chess engine.

Features

  • 3D chessboard with realistic lighting and materials
  • Move validation and support for castling and en passant
  • AI opponent using the Stockfish chess engine

3D Chessboard

The chessboard is created using the Three.js library, which is a cross-browser JavaScript library used to create and display 3D computer graphics in a web browser. The board is rendered using the WebGL API, which is a JavaScript API for rendering interactive 3D and 2D graphics within any compatible web browser.

The board is created using a mesh, which is a collection of vertices, edges, and faces that define the shape of the object. The mesh is then textured with a wood texture to give it a realistic appearance. The lighting is done using point lights and ambient light to create a realistic lighting effect.

Move Validation and Support for Castling and En Passant

The game includes move validation and support for castling and en passant, which ensures that the player can only make valid moves and that pieces are correctly removed from the board when captured.

AI Opponent using the Stockfish Chess Engine

The game includes an AI opponent that uses the Stockfish chess engine, which is one of the strongest chess engines in the world. The AI opponent provides a challenging opponent for players of all levels.

Getting Started

To run the game, clone this repository and open the index.html file in your web browser.

How to Play

  1. Click on a piece to select it.
  2. Click on a valid move to move the piece.
  3. The AI opponent will make its move.
  4. Repeat steps 1-3 until the game is over.

Credits

Conclusion

This 3D chess game is a great example of what can be achieved with the Three.js library. The use of 3D graphics and realistic lighting makes the game more immersive and engaging. The inclusion of AI opponent using the Stockfish chess engine adds a challenge for players of all levels. By exploring the code in this repository, you can learn how to create 3D graphics and games using the Three.js library.

chessboard-three.js's People

Contributors

ibra-kdbra avatar

Stargazers

BLK LUV [org] avatar  avatar

Watchers

 avatar  avatar  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.