Giter Club home page Giter Club logo

basic-blackjack's People

Contributors

devklick avatar semantic-release-bot avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Forkers

elliotsaii

basic-blackjack's Issues

Bug: All face cards are treated as having the same value when checking for high card win

One of the ways to win is by having the highest card. In such cases, even though face cards represent a value of only 10, they are not equal; queen beats jack, king beats queen etc.

At the moment, the logic to check if there's a winner by high score uses the "rank value" (10), so all face cards are seem as being equal. This needs to be updated to use a "global value" (which is a unique value each card has and can be used to determine the true order of value).

Add Responsive Layout

Currently the layout is pretty static and does not adjust to different screen sizes. This ticket covers the work to make the layout responsive.

Feature: Sound effects

Consider adding some sound effects to the game, e.g:

  • When cards being dealt
  • When hit/stick clicked
  • When warning pops up
  • When game won/lost

Bug: five card trick not awarded for player

Player should have won with a five card trick, but instead they are still in play and have the option to stick or hit for a sixth card, which should not be allowed.

Possibly related to #24 (late night coding on phone...)

image

Clean up the code

With this being my first ever react app (in fact, first ever front-end app!), there's a lot of code smell going on. I want to clean this up at some point:

  • Remove logic from components - they should more or less just be views
  • Remove metadata out of components (a lot of stuff in Card.tsx, for example, that doesnt really belong there)
  • Use barrel files (I hate seing SomeComponent/SomeComponent in my imports
  • Maybe introduce small state management (e.g. zustand)
  • Probably some other stuff

But before doing any of this, and arguably more important:

  • Write tests I'll take the risk

Fix release for Windows

I've been working on updating the release workflow and its no longer publishing the windows installer.

Need to revisit this.

Add app icon

The app is currently still using the default icon. The web app deployed to github pages (https://devklick.github.io/basic-blackjack/) still uses the default react icon, and the desktop apps built with electron (https://github.com/devklick/basic-blackjack/releases) still use the default electron icon.

There are icons in src/icons, but they're terrible and need to be binned and properly designed.

The scope of this ticket covers desigining the icon and adding it to both the github pages deployment (should just be a case of replacing the favicon.ico in the public folder), and using the same icon for the electron apps (which is not something I've looked into much, but there's some docs on it here)

Bug: Overlapping audio

Sometimes different sound effects can overlap. This typically happens with the CardDealt sound and either the RoundWon or RoundLost sound. The reason this happens is that the as soon as a card is dealt the sound CardDealt sound starts to play, and before it has finished playing, the new card has triggered either a win or loss, causing the sounds to overlap.

I would rather avoid these overlapping sounds if possible.

One approach to doing so would be to keep track of all sounds that the game has triggered, and have these automatically removed form the list when the sound finishes playing. When it comes to playing a new sound, we could check the list of playing audio, stop and remove anything currently in the list, then add the new one to the list and start it.

Another approach could be to delay the game from calculating the result. Currently, a card is dealt after a delay, in order to have a pause between cards being dealt. This also means than when the initial cards are dealt, there's a slight delay before the first card is dealt, which isnt ideal. Perhaps a more suitable approach would be to delay after a card is dealt. This may allow enough time for the CardDealt sound to finish playing before the resulting process kicks in and causes either the RoundWon or RoundLost sound from playing

Migrate from CRA to vite

CRA is no longer maintained and Vite appears to be the best alternative. This tickets covers the work involved in migrating from CRA to Vite

Feature: highlight winner cards / dim loser cards

To help make clear whether the dealer or player won the round, it might be good to either highlight the winners cards or dim down the losers cards.

At present, the only things that inform you who won the round is some text and the score.

The following will be considered:

  • change the colour of the winners cards entirely
  • apply a border around the winners cards to make them "glow"
  • make the losers cards semi transparent

Additionally (or alternatively), the space in the player names boxes could be utilized to add some more information that highlights the winner. The following will be considered:

  • line through losers name
  • bold the winners name
  • change colour of names
  • add "winner" and "loser" to the boxes
  • add smiley to winner and frowny to loser

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.