Share your repls and programming experiences

← Back to all posts
Basic Card Game
Anthony_Tonev (99)

Node js socket.io multiplayer card game. The game is just an experiment.

Please try running it at full screen https://basic-card-game--anthony-tonev.repl.co/

I like to draw and try to make an interesting project that involves art and card games are just that ( art peaces on cards that you play).

The idea is that you play as a king with a lot of vanity and you want to collect other kings crown gems. Each room has a color gem but this mechanic is not implemented yet. However the idea eventually is that you can gain these as a reward and showoff to other players.

RULES:
You can join rooms or create rooms. Once you click "add deck' your game becomes public and someone can join it by clicking "find game". The game will also start when you add deck if you are the second player in the room.

Quick Startup: Create Game -> RDM button -> ADD DECK button -> Open new tab -> paste same link -> ADD BOT button -> go to first tab and play -> when your turn is over press STOPWATCH -> bot will make a turn for 10 sec (sometimes he might not play anything) -> then it is your turn again.

Your deck has the size of 20 cards and you have to defeat your opponent with them by attacking him/her on his/her lifepoints (button bellow the crown icon). You can craft a deck from the card selection and if you want to use it again just copy the deck recipe and save it somewhere. Load it by pasting the recipe next into the input area next to add deck button and make sure you tick the checkbox.

You will know it is your turn when you see a golden "START" label on bottom right.
To end your turn before the timer goes 0 press on the stopwatch.

To play with A.I. - join a room and add a bot, then join the same room on a second tab and add a deck. That way the bot will play first. If you want to go first - add yourself first and add the bot on a second tab.

You gain gold each turn = the amount of slots you have free (no minions are summoned on them). Example: 6 free slots = 6 gold next turn. 3 free slots 3 gold and 0 = no gold next turn. That way you have to manage your income and you have to be careful not to overwhelm your opponent since he will gain gold and you will not.

Attack minions by selecting your minion and the one you want to attack then click the sword icon. The attack power of a minion is the number on the left. HP of the minion is the number on the right (the numbers are on the card itself or on the label below the minion in play).

You can cast one spell per turn (thunderbolt icon displays remaining charges) - spells are the orb icons, one is dark and other is light.

Light heals minions and if you have a heal power effect in play you can resurrect minions! You can inspect what died where by clicking the skull icon.

Dark deals 2 damage and can't kill minions but if you have dark power in play you can!

Some cards have battlecry effects - some can target enemy minions so make sure you target one by selecting before summoning.

Card art is drawn by me and I still have some redrawings to do.

When I have time I can play with someone - but I feel it will be best if I can chat to explain how to play it - so ping me on discord if you are interested (Anthony T. is my acc).

Here is a simple example of the variety of cards effects. 'Phase Shifter' can swap slots positions, the 'Witch' can turn enemy to a 1/1 'Frog' and the 'Magic Flower' gives you 2 spells charges per turn:

And here is an example of a "intense battle against the bot a.i.

Using dark power buff to destroy minions and attacking enemy LP directly:

Comments
hotnewtop
oluwamayowa (2)

Multi-featured, cool looking card game.
"Basic"

houdinimab (2)

Where is the source code?

slip1244 (256)

looks amazing, nice work!

Nanowrimoijk (59)

looks cool, but i cant figure out how to play

Anthony_Tonev (99)

@Nanowrimoijk I'm sorry it is a bit complicated I know :( I will find a way to make a simple tutorial or make it more intuitive.

Try vs bot in this order:
Create Game -> RDM button -> ADD DECK button -> Open new tab -> paste same link -> ADD BOT button -> go to first tab and play -> when your turn is over press STOPWATCH -> bot will make a turn for 10 sec (sometimes he might not play anything) -> then it is your turn again.

ChristopherLi5 (13)

And, I don't know how to create a deck.... but it seems like a good game to me! (that's actually saying something, since I didn't even play it)

Anthony_Tonev (99)

@ChristopherLi5 you just click on view cards and click on 20 of them and then click add deck button. Once you have clicked on 20 of the cards - you will notice that you can't select more (selection is making a white border around the card). You can deselect them by clicking on selected cards.

You will have the deck in a text down at the deck recipe so you can load it without selecting the cards next time.

To play - open a separate tab and join the game, then add bot.. Bot takes 10 seconds to play a turn.

Or find another player and play with him/her.

There is also a quick way to add a random deck by pressing rdm button and then add deck button.

mattdoan (17)

@Anthony_Tonev Another player? Could be a her.

By the way recipe is misspelled recepy in your game (just a side note).

Anthony_Tonev (99)

@mattdoan thanks - I fixed that now.

And yes it can be a her - I thought player is gender neutral word, is it not?

mattdoan (17)

@Anthony_Tonev "Or find another player and play with him."

him

Anthony_Tonev (99)

@mattdoan Oh yes - I'm sorry, updating right away. Thanks.

mattdoan (17)

@Anthony_Tonev It's still misspelled in the "Paste your recepy here" text box.

mattdoan (17)

I love this! Can't wait to see how far you will take this game!

mattdoan (17)

@mattdoan Well the graphics are good and the GUI is nice but I can't figure out how to place a card...

Anthony_Tonev (99)

@mattdoan first you need to have enough gold for it and then by clicking on the card and then on the slot should work I guess. IMPORTANT you need to have an opponent. And summoning only works in your turn.

EDIT: has to be in your turn - selecting card and if you have enough gold DOUBLE CLICK on filed slot.

mattdoan (17)

@Anthony_Tonev Uh sorry it still doesn't work. Here's what I did: Create Game -> RDM -> Add Deck -> Add Bot -> Tried to play cards. Still didn't work; is there something I'm doing wrong?

Anthony_Tonev (99)

@mattdoan
Create Game -> RDM -> add deck ( this will be your tab )
Open new tab -> find game (or copy paste same room link to make sure it is the same room) - > add bot

go back to your tab and play your turn then click on stopwatch and the bot will play and so on.

It is designed that way because bots are only for testing. The intent is to play with a real person - so bots are added just like a real person will join the game - on its own tab.

To recap here is a quick startup
Create Game -> RDM button -> ADD DECK button -> Open new tab -> paste same link -> ADD BOT button -> go to first tab and play -> when your turn is over press STOPWATCH -> bot will make a turn for 10 sec (sometimes he might not play anything) -> then it is your turn again.

mattdoan (17)

@Anthony_Tonev Wow that was a fast response! Haha! Thanks for the instructions.

Awesome game, I just tried it against a bot. Will definitely try my hardest not to quit Hearthstone for this!

Anthony_Tonev (99)

@mattdoan I am coding an email app right now and by doing so - installed a mail integration with windows - this gives me a quick notification from my mail and thus for repl.it comments too, pretty fast!

BTW if you are curious I use the bots to simulate real players by opening like 40 tabs and adding bots that play vs each other - If my math is correct more than 2000 people can play at the same time based on the amount of memory that 40 bots consume. Node handles it pretty well.

nodes.js has a limit of 1.76 GB

mattdoan (17)

@Anthony_Tonev Pappy you are my role model I'm level 13 and hopefully I can beat your score at your level. Sorry if I'm being annoying and spamming you with emails.

Anthony_Tonev (99)

@mattdoan
It's ok - I'm happy to correct stuff. Thanks a lot for the reports.

As for my "score" - I've found that coding is fun quite recently and can't get enough of it. I wish I had grasped the "fun of coding" earlier.

You are quite lucky that you are tinkering with code that early in life. No doubt you will make awesome stuff if you stick to it for long time. I wish I did but I was too involved with drawing and animations... They are fun too but not the same way as coding.

mattdoan (17)

@Anthony_Tonev I sent you a friend request on Discord.

Anthony_Tonev (99)

@MatthewDoan1 I've made lots of updates locally - haven't uploaded them here yet - they are live at my heroku build
https://basic-cardgame.herokuapp.com/.