🚀 [GAME] Play SOLITAIRE!!! another awesome game! 🚀
RolandJLevy (759)

This game is so addictive - it tests your speed, logic and skill - it’s a race against time….

I built this from scratch in 10 days using vanilla JS and CSS. It's really fun to play. Below is a demo and instructions. See if you can finish with just one marble remaining in the centre of the board - there is a 1,000 point bonus if you can do it! 😄

⚡ Solitaire ⚡

Links 🔗

Demo 🏁

https://github.com/rolandjlevy/js-solitaire-game/blob/master/images/solitaire-demo-large.gif?raw=true

How to Play 👉

  • Aim of the game
    Take away as many marbles as possible in the 100 seconds countdown.
  • How to take away marbles
    Select a marble by clicking on it so it turns blue, then place it over an adjacent marble into an empty space. The marble you move over will be taken. To deselect a marble, click on it again so it turns from blue to gold. See the demo above ⬆
  • Scoring
    Each marble removed updates the score by the total marbles taken multiplied by the total seconds remaining. Eg, 20 marbles taken in 40 seconds scores 800. Finish the game at any time to submit your score to the Leader Board.
  • Bonus points
    If you finish with just one marble remaining, which is 'Solitaire', you get a bonus 500 points, and if your last marble finishes in the centre of the board the bonus is 1,000 points!

Features 💡

  • Built from scratch with Vanilla JavaScript and CSS; no front-end frameworks or libraries like React, Vue etc...
  • Completely responsive and mobile friendly
  • Includes Help section and Leader board
  • Scores are saved on the back-end with Google Firebase
You are viewing a single comment. View All
Spitfier720 (24)

There's even sound? I N V E S T

All jokes aside, could you update the code so that when there's no move to make, then to immediately stop?

RolandJLevy (759)

@Spitfier720 thanks for your feedback. Yes that's a good idea, I agree. This is a feature I would like to have. I tried but the logic was quite complex.

Spitfier720 (24)

@rjlevy you could try going through each of the pieces and seeing if they can make a move, and if none of them can, then exit

RolandJLevy (759)

Hi @Spitfier720, yes that's the solution. I tried to write the code for it a few weeks ago but it was difficult. I might try again. Do you think it would improve the game?

Spitfier720 (24)

@rjlevy i think that would greatly improve the game, since it would stop the game immediately, and since your score is based on time, it would present a more accurate kind of score

you could also make some sort of penalty or something if there are no moves available and more than one marble left

RolandJLevy (759)

@Spitfier720 thanks, yes - I agree it would improve the game. In terms of penalty, with the countdown timer there is already a penalty with every second wasted. Two things to motivate people is moving as quickly as possible and aiming to finish with just one piece remaining :)