silvericarus / just-chess Goto Github PK
View Code? Open in Web Editor NEWA version of chess made in HTML5 and Vanilla Javascript, using the Bulma framework
License: GNU General Public License v3.0
A version of chess made in HTML5 and Vanilla Javascript, using the Bulma framework
License: GNU General Public License v3.0
Right now, the Game starts as soon as you load the page. The idea is to create a landing page where you can see the running games, create a new one, join a running game and then, start the game. It must use the elements in the Bulma framework and the color palette is to be chosen yet (proposals are apreciated). This issue is just for the HTML file, the inner working of the file (JS) would be created in another issue. A temporal structure for the page is in the listgames.html file.
#2 When you drag a Pawn you can drop it in any column in the row ahead.
Their movement is defined by:
They can move in the x and y axis indefinitely until they find another piece.
Castling consists of moving the king two squares towards a rook on the player's first rank, then moving the rook to the square over which the king crossed. Castling may only be done if the king has never moved, the rook involved has never moved, the squares between the king and the rook involved are unoccupied, the king is not in check, and the king does not cross over or end on a square attacked by an enemy piece. Castling is one of the rules of chess and is technically a king move.
Check:
A check is a condition in chess, shogi, xiangqi, and janggi that occurs when a player's king (or general in xiangqi and janggi) is under threat of capture on their opponent's next turn. A king so threatened is said to be in check. A player must get out of check, if possible, by interposing a piece between the threatening piece and the king, capturing the threatening piece, or moving the king to a square where it is no longer in check. If the player cannot move out of check, the game ends in checkmate and the player loses. Players cannot make any move that puts their own king in check.
Checkmate:
Checkmate (often shortened to mate) is a game position in chess and other chess-like games in which a player's king is in check (threatened with capture) and there is no way to remove the threat. Checkmating the opponent wins the game.
Stalemate:
Stalemate is a situation in the game of chess where the player whose turn it is to move is not in check but has no legal move. The rules of chess provide that when stalemate occurs, the game ends as a draw. During the endgame, stalemate is a resource that can enable the player with the inferior position to draw the game rather than lose. In more complex positions, stalemate is much rarer, usually taking the form of a swindle that succeeds only if the superior side is inattentive. Stalemate is also a common theme in endgame studies and other chess problems.
Firebase must save the current board state, send the moves to the other client and serve as the backend.
Elements for footer
Log of modifications
Thanks
Copyright
Link to my web
Log of modifications
thanks
Copyright
Link to my web
Footer
The queen is the first of the "complex" pieces to code. It's movement, given its initial position (x.y), is:
It should be placed below the playground and updated after moving a piece in both.
Describe the bug
The Pieces that are destroyed aren't synced, they need to be put in firebase as well.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The destroyed piece showing in the graveyard in both players screens.
Step 1: Add the library
Include via CDN:
<script src="https://cdnjs.cloudflare.com/ajax/libs/airbrake-js/1.6.2/client.min.js"></script>
We also support installation via npm or Bower.
Step 2: Copy this config snippet to your app.js
file
(You can find your project ID and API KEY with your project's settings):
var airbrake = new airbrakeJs.Client({
projectId: <Your project ID>,
projectKey: '<Your project API Key>'
});
To test that Airbrake has been installed correctly in your JavaScript project, just open up the JavaScript console in your internet browser and paste in:
window.onerror("TestError: This is a test", "path/to/file.js", 123);
Visit our official GitHub repo for more info on alternative configurations and advanced options.
When you start dragging a piece, you should change the bg-color of the cells within reach of that piece. This was suggested in #2
View details in Rollbar: https://rollbar.com/silvericarus/JuSt-Chess/items/11/
(unknown): Script error.
File "(unknown)", line unknown, in [anonymous]
Currently, the landing page is index.html, change it with listgames.html so it becomes the landing page.
View details in Rollbar: https://rollbar.com/silvericarus/JuSt-Chess/items/3/
TypeError: elementdata is null
File "https://silvericarus.github.io/just-chess/js/main.js", line 140, in drop
File "https://silvericarus.github.io/just-chess/", line 1, in ondrop
View details in Rollbar: https://rollbar.com/silvericarus/JuSt-Chess/items/2/
TypeError: Cannot read property 'classList' of null
File "https://silvericarus.github.io/just-chess/js/main.js", line 140, in drop
File "https://silvericarus.github.io/just-chess/", line 1, in HTMLTableCellElement.ondrop
Create all the pawns in the app and design their movement.
This is a test issue created by Rollbar. If you can see this, it works!
The description should explain what is the game and how to enter a match, and the instructions should enumerate all the things needed to know in order to play.
The bishops move diagonally until they encounter another piece, given an initial position (x,y) they can move to (x+i,y+i); (x-i,y-i); (x+i,y-j); (x-i,y-j)
The king can move on the same pattern as the pawns, one cell at a turn, so given initial position (x,y), it can move to:
The knights are the most complicated piece to code, because you have to manually check all of its posible movements, which are (given initial position (x,y)):
That causes errors in console and sometimes you drag multiple pieces at the same time.
In the DB, there's a field called playersConnected. When it's not set, the player who connects arrives at a blocked screen, waiting for another player to connect. When this number its 1, it means that when the player connects, the two players get unblocked and can start playing.
View details in Rollbar: https://rollbar.com/silvericarus/JuSt-Chess/items/12/
FirebaseError: Document path must be a non-empty string
File "webpack:///../firestore/dist/esm/src/util/error.js", line 140, in FirestoreError
var _this = _super.call(this, message) || this;
File "webpack:///../firestore/dist/esm/src/api/database.js", line 1184, in [anonymous]
throw new FirestoreError(Code.INVALID_ARGUMENT, 'Document path must be a non-empty st...
File "file:///C:/Users/Silver/Documents/Programaci%C3%B3n/just%20chess/chess.html", line 112, in [anonymous]
Is your feature request related to a problem? Please describe.
Authentication is needed for firebase data sending and receiving.
Describe the solution you'd like
A funtion that authenticates in firebase my app, so the player can play as much as he wants.
Describe alternatives you've considered
Singing up in the app would be too much, maybe finding something else a bit easier would be better.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.