Develop Trading Card Game Battle System With Unity 3D: Part XXI (Game Over, Restart, Computer AI) | Vladimir Limarchenko | Skillshare

Develop Trading Card Game Battle System With Unity 3D: Part XXI (Game Over, Restart, Computer AI)

Vladimir Limarchenko, Game Developer, Unity3d and C#

Play Speed
  • 0.5x
  • 1x (Normal)
  • 1.25x
  • 1.5x
  • 2x
2 Videos (45m)
    • Game Over Condition and Restarting the Game

    • Computer AI


About This Class

In this class/series we set an ambitious goal of developing our own trading card game with Unity3d and C#, mostly focusing on card game battle mechanics.

Since we are mostly focusing on battle mechanics, this battle scene is the only scene that we have in this project. When one of our players dies, we'd like to display a game over message and a simple button that will let our players restart the same battle.

The second and most important topic of this class is enabling AI for this project and letting our players play against the computer. The main difference between our human players and our AI/computer player is located in the TurnMaker.cs class. When the turn starts, both human and AI players draw a card, there are some common start turn actions for both of them. After all these common actions are complete, nothing else is going on in our scripts for human players. All the further decisions are entirely up to our players.

In contrast, for AI players in the start of each turn we start a coroutine that will analyze all the possible moves and pick one of these next options at random:

  • Play a random card (spell or creature).
  • Attack with one of the creatures on the battlefield.
  • Use hero power.

AI will search for new moves until he runs out of mana or out of cards.

With this class you will gain access to a compete, fully functional Unity project that is an example of a card game battle. The game mechanics are somewhat similar to Hearthstone: custom spells, hero powers, creature effects and so on.

Additional information:

  • The files showed in the course are downloadable from the link that you can find in the "Class Project".
  • The next class of this series will be published on 2017.01.22.





  • --
  • Beginner
  • Intermediate
  • Advanced
  • All Levels
  • Beg/Int
  • Int/Adv


Community Generated

The level is determined by a majority opinion of students who have reviewed this class. The teacher's recommendation is shown until at least 5 student responses are collected.

Vladimir Limarchenko

Game Developer, Unity3d and C#

I am a Unity3d and C# developer with about 2,5 years of experience in game development. I also have a scientific background. I got a Ph.D. in Theoretical Mechanics in 2014, but then decided to pursue my childhood dream of becoming a game developer. I'm mostly interested in making 2D games. In my opinion, a perfect game should have some tactical or puzzle element to it.

Over the last couple of years I've also worked as an instructor and created several courses on game development. Some...

See full profile

Report class