Gamelogic
  • Home
  • Blog
  • Tools
    • Grids 2 (for Unity)
      • Features
      • Documentation
    • Grids 1 (Legacy, for Unity)
      • 30 games in 30 days
      • Features
      • Tutorials, Documentation, and FAQ
      • Games made with Grids for Unity
      • Examples
      • What is new?
      • Grid Prototypes and Previews
      • Buy
    • Extensions
    • Colors
      • Features
      • Documentation and tutorials
      • Buy
    • Words
      • Features
      • Documentation
      • Buy
    • Abstract Strategy
      • Features
      • Documentation and tutorials
      • Examples
      • Buy
    • Match
      • Features
    • Grids (for GameMaker)
      • 30 games in 30 days
      • Features
      • Documentation
      • Buy
  • Buy
  • Articles
  • Support
    • Knowledge Base
    • Email Support
  • About
    • Meet our team

Using victory conditions

Victory_Conditions

  1. Add a default Victory condition on the GameBoard GameObject.
  2. Configure the Victory condition on the inspector.
  3. More than one Victory Condition can be added.

You can add a handler to the OnGameOver event on the Game Manager to execute code. Note that it will only be called when all the players have a victory states assigned. To know who won or lost, look at the Winners and Loosers property in the game manager.

In the below example, a player wins when three pieces are connected in a verticle or horizotal line.

VictoryConditions

To check out this example:

  1. Import Abstract Strategy in a new project.
  2. Import the package below into the same project.
  3. Open the VictoryConditions scene.

VictoryConditions.unitypackage

Share this:

  • Click to share on Facebook (Opens in new window)
  • Click to share on Twitter (Opens in new window)
  • Click to share on LinkedIn (Opens in new window)
  • Click to share on Reddit (Opens in new window)
  • Click to share on Pinterest (Opens in new window)

Related

  1. Moving a piece and changing turns  Setup a game board with pieces as explained in this...
  2. Animating a piece in the board  To have pieces animate when they move, follow these steps...
  3. Setting up a grid and board  (To Learn more about Grids, see the documentation page for...
  4. Documentation and tutorials  Tutorials Basic  Setting up a grid and board Moving a...

  • Home
  • Features
  • Blog
  • About
  • 14 Eglin Road, Sunninghill, Johannesburg, South Africa
  • support@gamelogic.co.za
Stay Connected
  • Facebook
  • Google
  • Linkedin
  • Rss
  • Twitter
  • Gamelogic © 2013