Posts

Showing posts from May, 2016

Connect 5 App

Image
Connect 5 App     I started working on a Connect 5 Game app in Unity, you can see the full project here:  https://github.com/viktordd/Connect5 The rules of the game are simple and similar to Tic Tac Toe.  It's a 2 player game. Each player places an X or an O in a grid of infinite size, the first player to connect 5 of his own mark in any direction wins. Currently the UI supports touch gestures to move the board and pinch and zoom. Each time the view port is moved, the game checks the edges and either adds, or removes squares to keep only locations that are currently visible. I keep track of the whole board in a 2D-array, which holds which squares are currently drawn, and if a square has an X, O, or is empty. Every time a player places a mark, the game checks to see if the there are 5 consecutive marks and displays a winner popup. I also keep track of all moves, and can undo and redo moves.