SameGame engine made with Unity and C#
Read all posts about "SameGame" game
Probably you did not notice it, but this month I am really into SameGame engines and after the HTML Phaser version now it comes the Unity version, made with C# trying to keep the code structure as similar as possible to the Phaser version I showed you in the post HTML5 SameGame engine powered by Phaser.
This is the working prototype, you should know how to play it:
Pick a tile with at least another adjacent tile of the same color to remove them.
The code is uncommented but next week you will see a step by step coverage about making this engine with Phaser Vs making this engine with Unity.
This is the class used for the tile, had to do it to create custom properties:
using UnityEngine;
using System.Collections;
public class tileScript : MonoBehaviour {
public int value;
public Vector2 coordinate;
}
And this is the main game:
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class Script : MonoBehaviour {
public GameObject tileObject;
private Color[] colors = new Color[4];
private GameObject[,] tilesArray = new GameObject[8, 8];
private int numRows = 8;
private int numCols = 8;
private Listdownload the entire project.