Simple DeckStacker card games are provided in the Unity Package to help give you examples of how it can be utilized.
The example games are:
-
Stacks Demo
-
War
-
Tic-Tac-Toe
-
Jumble Chess
Example Project: Stacks Demo
Stacks Demo Scene
This is a very basic implementation of DeckStacker. To access it, load the following scene in Unity:
DeckStacker/StacksDemo/Scenes/StacksDemoScene.unity
This scene demos some fundamental functionality of DeckStacker.
In it, you will find:
- A variety of Stacks
- Throughout the scene, there are examples of different arrangements of cards (rows, columns, piles, tight, loose, fan, and undefined)
- Clicking on cards will “select” them
- When a card is selected: Clicking on another card or stack will send the selected card to that stack.
- Long-press on a card will fade that card to be semi-transparent
- Click-and-drag on a card in the “Player Hand” will initiate a “grab” on the card, allowing you to drag the card around the screen.
- The Player Hand has grab-reordering enabled, allowing you to change the order of the player hand.
- Letting go of the drag will return the card back to its place in the Player Hand
- No gameplay in this one. Just cards being moved and arranged.
Example Project: War
War Card Game Scene
This is a simple implementation of the child’s card game War. To access it, load the following scene in Unity:
DeckStacker/WarCardGame/Scenes/WarCardGameScene.unity
- This is a very bare-bones game, which only asks the player to click on one button: “Flip”
- This will initiate a turn in War, which will automate the result, including if there is a tie.
- I have added an additional rule for War: Jokers are allowed in the deck, and will automatically be considered a tie, no matter what the opponent’s card is.
- This demos DeckStacker’s action queue fairly well, and will even queue up additional presses of the Flip button, allowing the player to spam the button and watch a series of turns take place.
Example Project: Tic Tac Toe
Tic-Tac-Toe Scene
This demo is a simple implementation of the child's game TicTacToe. To access it, load the following scene in Unity:
DeckStacker/TicTacToe/Scenes/TicTacToeScene.unity
- It was made to demo how a card’s state can be changed, including the art on a card.
- When the game starts, all cards are considered “generic” and are face down.
- When a player clicks on a card, the game reads whose turn it is and will change the card to that player’s card, and then flip it.
- Afterwards, the board state is evaluated and a winner or CAT is declared, if the game is over.
Example Project: Jumble Chess
Jumble Chess Scene
This demo is the most complex demo game: A variant of chess. To access it, load the following scene in Unity:
DeckStacker/JumbleChess/Scenes/JumbleChessScene.unity
This game demonstrates a game with much more complicated rules, but it still boils down to the same concept (one thing happens at a time).
- High concept:
- A chess game where the pieces are all cards
- Pieces are face down at start
- Pieces are shuffled before being distributed on the board.
- Additional rules…
- If you flip over a piece and it has a valid move available, you must move it.
- With the exception of the King, pieces can stack on top of eachother.
- When a player takes a space occupied by their opponent, the player takes ALL pieces in that space, not just the top piece.
- Long press on a space with more than 1 piece, and a tooltip will appear, displaying the pieces in the stack.