GithubHelp home page GithubHelp logo

ido-barnea / chess-but-better Goto Github PK

View Code? Open in Web Editor NEW
3.0 3.0 2.0 6.61 MB

Chess But Better is chess, but with a few extra layers of complexity. Try playing the game at https://chess-but-better.onrender.com.

License: Apache License 2.0

HTML 1.07% CSS 3.63% TypeScript 95.05% JavaScript 0.25%
2d-game board-game chess chess-games css game gamedev games html javascript strategy typescript web web-game webpack website

chess-but-better's Introduction

Hi ๐Ÿ‘‹, I'm Ido

My Stat Block

chess-but-better's People

Contributors

dependabot[bot] avatar ido-barnea avatar monkey-bored avatar omoorion avatar sfarazh avatar zargad avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

sfarazh omoorion

chess-but-better's Issues

Always use piece class for board movement

Currently, the board is initialized like this:

var board = [
'r', 'b', 'n', 'q', 'k', 'n', 'b', 'r',
'p', 'p', 'p', 'p', 'p', 'p', 'p', 'p',
'', '', '', '', '', '', '', '',
'', '', '', '', '', '', '', '',
'', '', '', '', '', '', '', '',
'', '', '', '', '', '', '', '',
'P', 'P', 'P', 'P', 'P', 'P', 'P', 'P',
'R', 'B', 'N', 'Q', 'K', 'N', 'B', 'R',
]

The lower letters signify the color black and the capital letters signify the color white.
This should change to use the appropriate class for each piece.

Add highlight of the last move

Please highlight the square from which they moved and the square it is now in.
For example:

  1. If the white pawn moved from e7 to e6; you should highlight e7 and e6.
  2. If the black queen moved from f4 to b4; you should highlight f4 and b4.

Please highlight the square from which a piece arrived in a darker color than the piece's destination square.

Logic and UI seperation

The code will be more understandable if all the logic would be self contained and would not depend on UI functions and variables.

Create UI for logs

Logs are currently written using console.log() spread throughout the code.
Please add a UI element where logs are actively printed.

Fix Friendly Fire Bug (feature no longer working)

pieces unable to eat any other piece on their team except for themselves, in addition, after eating themselves their turn doesn't change to the opposite team but they gain a bonus turn for some reason?

Write documentation

  • Create developer documentation.
    • How to set up the project.
    • Information about the project itself.
    • The tools we use.
    • etc.
  • Create user documentation.
    • How the game works.
    • How it differs from the average chess game.
    • The secret rules.
    • The new pieces.
    • The boards
    • The items.
    • The gold and XP systems.
    • etc.

Pawns can't kill pawns of the same color

Steps to reproduce:

  1. Try to kill a Pawn with another Pawn of the same color.

Note that the bug only applies to Pawns, not other pieces of the same color and type.

Add UI for secret rules.

The UI should show a list of revealed rules. When a new rule is revealed, it should also be added to the UI.

Hit box getting bigger

Steps to reproduce:

  1. Place any piece anywhere and see that the hit box of the square is augmenting a bit.

Reference picture:
Screenshot 2023-10-17 234537

Color code the logs

Give each log type a different color. For example, normal movement logs could be gray, Secret Rules logs could be purple, kill logs could be red, etc.

Fix not being able to eat pieces sometimes on Firefox

For some reason, sometimes, when trying to eat a piece, the following error occurs:

Uncaught TypeError: _targetCoordinates is null
isValidMove file:///home/omoor/Downloads/Chess-But-Better-main/app.js:232
onDragDrop file:///home/omoor/Downloads/Chess-But-Better-main/app.js:158

The error seems to only occur on Firefox.

To reproduce:

  1. white P moved from (3,6) to (3,4).
  2. black p moved from (4,1) to (4,3).
  3. black p was killed by white P. -> error occurs here.

Add new rules

Requested Rules

  • Coup: When a player is in debt for three turns in a row, a random amount of his pieces defect to the enemy side (except for the King).
  • The Other Side: When a piece falls off the board, there is a 50% chance that after three turns, it will spawn on a random square in a random board.
  • Bounty: If a piece kills three enemy pieces in the Overworld Board, it receives a bounty. When that piece is killed, the killing player receives five gold pieces.

Create new boards

  • Create heaven and hell boards.
  • Create a functionality that determines where a piece goes when it is killed. If a piece didn't kill another piece, it goes to heaven. If it did, it goes to hell.
  • Create buttons that switch between board views.
  • Reveal new boards buttons as new boards are revealed to the player (i.e. if a piece goes to heaven, reveal heaven board button).
  • Make sure that if a piece spawns on another piece, it captures it.

Create winning condition

Requested Features

  • For a player to win, he must kill the other player's king in the hell board. Please write the logic for that.

King can skip a turn.

Steps to reproduce:

  1. Throw all the pieces that are to the right side of the king out of the board.
  2. Try to castle with the king.

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.