Erik
Erik

Reputation: 1

How to fix chess.js implementation for index.html

Im trying to build multiplayer chess game and implement it in steps.

  1. Display a chessboard in javascript
  2. Use chess.js to get available moves and playable game
  3. Implement multiplayer, host a server, with ability to change some rules of the game to analyze network data
  4. Use node.js and socket.io for multiplayer

I found another project that works but I want to implement this myself. However I got stuck on implementing chess.js by itself. The repo contains just a .ts file which I don't know what to do with. I tried to add it to my project but did not work. https://github.com/jhlywa/chess.js

I currently have chessboard.js in my index.html like this:

<html>
  <head>
    <title>Chess</title>

    <!-- Import chessboard css -->
    <link rel="stylesheet" href="css/chessboard-1.0.0.min.css">

    <!-- Import jquery -->
    <script src="https://code.jquery.com/jquery-1.12.4.min.js"></script>

    <!-- Import chessboard -->
    <script src="js/chessboard-1.0.0.min.js"></script>
    
    <!-- Import chess.js -->
    <!-- <script src="chess.js"></script> -->

  </head>

  <body>

    <!-- Display chess board -->
    <div id="board1" style="width: 400px"></div>

    <!-- Initialize chess board-->
    <script src="app.js"></script>

  </body>
</html>

Upvotes: 0

Views: 200

Answers (0)

Related Questions