diff --git a/docs/ARCHITECTURE.md b/docs/ARCHITECTURE.md new file mode 100644 index 0000000..e86d232 --- /dev/null +++ b/docs/ARCHITECTURE.md @@ -0,0 +1,24 @@ + +# Scenes + +The project should have two scenes. First, `loader` scene. It should contain +all module initialization, and then should proceed to `lobby` scene. + +`lobby` scene should contain main game UI and all objects needed for game +functionality to work. + +# Modules + +## Savegame + +Savegame module manages saving and loading user's progress achieved throughout +the game. All in-game currency values, passed levels (if any) and so on. + +Savegame module should have a method for triggering of saving current game state. +It should have several classes inside it, each handling its own part of the save. +When asked for save, it should enumerate all those and put all data into JSON +where key is class name and value is an object with data, produced by that class. + +Loading of the game should occur on game start and be performed in reverse order - +parse JSON, then enumerate all classes and trigger every of them to parse its data. + diff --git a/docs/ART.md b/docs/ART.md new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/docs/ART.md @@ -0,0 +1 @@ + diff --git a/docs/GAMEPLAY.md b/docs/GAMEPLAY.md new file mode 100644 index 0000000..26a41ed --- /dev/null +++ b/docs/GAMEPLAY.md @@ -0,0 +1,65 @@ +# Gameplay description + +Main gameplay cycle is a match of classical `fool` card +game described here as follows. + +Card is considered `open` when players can see its front face and +know its suit and value. Otherwise card is considered `closed`. + +Game is played with standard 36-card deck. + +For now we will form gameplay with two players, game user and computer opponent (bot). + +Every player is drawn 6 cards. One card from the rest is laid +open on the table and denotes a trump suit. Cards with the same suit as +trump suit card are called trumps. Rest of the cards are +shuffled and form the deck. + +Players make moves in turns. First move is made by player with lowest +card of trump suit in his hand. If there's a tie (e.g. no player has trumps), +player with the lowest card in his hand makes first move. If there's a +tie, first move is done by random player. + +To make a move player (call him attacking player) chooses one card from his hand and +lays it open on the table. The next player in clockwise order (we will call him +defending player) must beat this card. To do so, he chooses from this hand +a card of same suit and greater value, or a trump. If defending player needs +to beat a trump, this could be done with a trump only. All cards which are to be +beaten by defending players we call `attacking cards`. + +All players (including attacking players) can add cards to the attack. Only +cards with same value as any card laying on the table (initially added for +attack or used by defending player) can be added. + +* In any move there could be not more than 6 attacking cards (5 cards if it is the first move +of the game). +* There should not be more attacking cards than card amount in defending player's +hand. +* Cards can be added to attack at any time by any player except defending player. + +If defending player beats all attacking cards and no one wishes to add more, +the turn end and all cards from attack are discarded. Then, every player (starting +from attacking player, then in clockwise order except defending player and defending +player the last) draws cards from deck until they had 6 cards on hand (or the deck is empty). +The card denoting trump suit is considered last card of the deck in this process. + +After drawing cards move is passed to next player in clockwise order. +When a player has no cards left (after drawing phase) he leaves the game (all other +players continue play). When only one player is left he is considered loser of the +game. + +# Bot logic + +## Basic bot + +When in need to make move, choose non-trump card with least value among all in hand. +If there is none, choose trump with least value. + +When choosing what to add to attack, add all eligible non-trump cards. Add trump cards +only when the deck is empty and you have only trump cards in your hands. + +When defending always choose suitable card with least value. Prefer defending with non-trumps +first, use trumps only when necessary. + + + diff --git a/docs/LOBBY.md b/docs/LOBBY.md new file mode 100644 index 0000000..bff666e --- /dev/null +++ b/docs/LOBBY.md @@ -0,0 +1,8 @@ +# Lobby scene + +There should be a button for starting new +game. This button should load and run main gameplay cycle +(described in GAMEPLAY.md). + +After gameplay cycle finish, user should be returned to +lobby scene. diff --git a/docs/UI.md b/docs/UI.md new file mode 100644 index 0000000..43e0ad3 --- /dev/null +++ b/docs/UI.md @@ -0,0 +1,2 @@ +UI should be fitted for using on portrait-oriented mobile +phones with different screen aspect ratios (from 4:3 to 21:9).