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! 😄
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
The HTML repl fetches images from Unsplash by sending a request to this Express endpoint using the search input as the query, which is 'trees' in this example: https://node-api-keys.rjlevy.repl.co/json?s=trees
This has been a great learning experience, so thanks again!
🚀 [GAME] Play SOLITAIRE!!! another awesome game! 🚀
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 👉
Take away as many marbles as possible in the 100 seconds countdown.
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 ⬆
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.
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 💡
Hi @AmazingMech2418, thanks a lot for your help - I think it's much clearer for me now so I made a simple example of what you suggested...
I made this Express repl: https://repl.it/@rjlevy/node-api-keys which has the .env file containing Unsplash API keys and various endpoints. It can be tested here.
Then I made this HTML repl: https://repl.it/@rjlevy/html-unsplash-search-without-api-keys which can be tested here.
The HTML repl fetches images from Unsplash by sending a request to this Express endpoint using the search input as the query, which is 'trees' in this example: https://node-api-keys.rjlevy.repl.co/json?s=trees
This has been a great learning experience, so thanks again!