This is an online interactive online game build using trpc
with fastify
, react-native
and nextjs
.
This is the folder structure of the blackjack
mono repo.
📁 packages
|---📁 server
|---📁 web
|--- 📁 mobile
📁 prisma
📁 assets
|---📁 cards
|---📁 back
|---📁 jacks
|---📁 png
|---📁 svg
The following are the back covers that players can select before starting the game:
These instructions shows how to test this game locally. You can follow the README
files in respective packages:
After you have installed the dependencies of each package you can start the game by navigating to the root directory which is the blackjack
and run the following command:
yarn start
This will start all teh packages in parallel. And you will be able to test them.
In this section I will show the screenshots of the UI of the web
and mobile
version of the game.
- auth screens
- app/game screens
- auth screens
- app/game screens
blackjack
is an online game that allows users to play remotely. So here is how you can use the game.
- you need an account with
nickname
andpassword
- you can create a single instance of
engine
/environment
that you can play with your friend. - the creator of the
engine
is the engine admin and he has the authority to:- remove
gamers
start
and stop thegame
- remove
- other players can play as regular users within the game
engine
. - real time updates are given to those
gamers
that are in a certain game environment orengine
- regular users and even the admin can leave the engine anytime they want to.
- when the game is completed the results are shown to every connected
gamer
with positionsnicknames
andpoints
- During starting of the game the admin can select the card they want to use as a
blackjack
and also thebackcover
foranonymous
cards. - gamers within the engine can also chat using the
chat
platform.
Everyone has a chance to win the game. Here is how the game is played:
-
Since it is a multiple player game, every
gammer
has a number and the playingturns
moves inascending
order of numbers meaning: _ player number 1 plays first. _ the last player will play lastNote that the maximum number of players allowed to be in a game
engine
orenvironment
are5
players andminimum
for the game to be able to start are2
players. -
You match cards that have same name for example a
Q
and aQ
, a2
and a2
, it doesn't mater whichQ
is it it can be ofhearts
,clubs
,spades
ordiamonds
. Here is an example of matching cards.
So to match these cards you just need to click the first
card and click
the next one, then your cards will be updated.
-
In the event that your matching cards are finished you click the
DONE
button so that the next player in ascending will play next. -
After all the matching cards has been finished on all the gamers, now gamers can start picking up the
cards
for thenext
ascending player. When you see that you picked thematching
card you can match and clickDONE
button so that the next player will also pick from whoever he should pick from.
Note that if you pick a card, as an important rule if the card match play it and click the
DONE
button if not just click theDONE
button so that next players get their chances.
- The process will be looped till all the cards are finished. The player that will be left with
JACK_OF_CLUBS
orJACK_OF_SPADES
will loose the game, here are the jacks that we are talking about.
I give credits to this website where i got the .svg
and .png
cards image faces from.
In this project I'm using the MIT
license which reads as follows:
MIT License
Copyright (c) 2023 crispengari
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.