[JAVA] I made the server side of an online card game ①

Introduction?

I did my best to make a card game for school assignments and hobby game production, so I decided to drop it. The game I made this time is a card game called Black Poker. Some of the people who have seen the tag "Hey, isn't it a card game even though it has a TCG tag?" I think some people thought that. However, although this game does not have trading elements, it is a game packed with recent TCG elements of building a deck and attacking each other with cards drawn from the deck.

What is Black Poker?

It is a turn-based TCG-style card game that uses one set of cards for each person. (Quoted from the official website) Each other cuts the deck well. Turn one from the top of the deck, and the one with the larger number / mark will be the first player. Draw 7 cards from each other's deck. The turn player draws a card from the deck and does the following: ① Take 1 point of damage and place the card face down from your hand (Turn 1) ② Take 1 point of damage, turn the face down card sideways, and put the card face up from your hand (Turn 1) ③ Select n of your own face-up cards and attack (with summoning sickness) The attacked player blocks or takes damage with the cards in the field.

The damaged player sends n cards from the deck to the graveyard. Players who run out of decks lose the game.

First, make the game body

Although it is server-side development, we will set aside communication etc. and first create the main body that operates on the console.

I designed the following

UML図.png

A Card object corresponding to each card of playing cards is generated, and the Player moves the Cards in the member.

I'm tired, so this time it's up to here. Next time I will write a card class.

Please refer to the program as it is also placed on GitHub. Black_Poker4j

Next time

Recommended Posts

I made the server side of an online card game ①
I made a server side of an online card game ⑤
I made a server side of an online card game ③
I made a server side of an online card game ⑥
I made a server side of an online card game ④
I made a server side of an online card game ②
I made an eco server with scala
I tried using the Server Push function of Servlet 4.0
I tried JAX-RS and made a note of the procedure
I tried to solve the Ruby bingo card creation problem (there is an example of the answer)
I made the "Sunshine Ikezaki game" I saw on Twitter in Java.
I tried to build the environment of PlantUML Server with Docker
I enjoyed the Advent of Code, an overseas competition professional contest
I made a gem to post the text of org-mode to qiita
I tried to check the operation of gRPC server with grpcurl
I made a tool to output the difference of CSV file
I read the source of ArrayList I read
I read the source of Integer
I read the source of Long
I made an annotation in Java.
I read the source of Short
I read the source of Byte
I read the source of String
I examined the flow of TCP communication with Spring Integration (server edition)
Compare the elements of an array (Java)
I investigated the internal processing of Retrofit
[day: 5] I summarized the basics of Java
The story of making an electronic New Year's card app with Vue.js + Rails
The training for newcomers was "Make an app!", So I made an app for the time being.
The strongest Omikuji app that only I, an EKS Lover, can think of