Actually it was trickier than I thought it would be, add this code to a game object then you just need a cube and sphere or two other gameObjects to represent the walls and player.
You also need to set up the camera to look at the grid.
Note no colliders or bounds checking needed.
using UnityEngine;
using System.Collections;
// GridRunner - Allan Rowntree - Arowx.com
// Ultra basic retro maze game - No physics or bounds checking just an array
public class GridRunner : MonoBehaviour {
public int[,] grid = {
{1,1,1,1,1,1,1,1,1,1},
{1,0,0,0,0,0,0,0,0,1},
{1,0,1,1,0,0,1,1,0,1},
{1,0,1,0,0,0,0,1,0,1},
{1,0,0,0,1,1,0,0,0,1},
{1,0,0,0,1,1,0,1,0,1},
{1,0,1,0,0,0,0,1,0,1},
{1,0,1,1,0,0,1,1,0,1},
{1,0,0,0,0,0,0,0,0,1},
{1,1,1,1,1,1,1,1,1,1}};
public GameObject block;
public Transform player;
public Vector3 oldPos;
public Vector3 newPos;
public float delta = 0f;
public Vector3 nextMove;
public float speed = 0.5f;
public float inputDelay = 0.1f;
public bool inputDelayed = false;
void Start () {
Vector3 pos = Vector3.zero;
Vector3 offsetX = Vector3.right;
Vector3 offsetY = Vector3.forward;
Vector3 playerPos = Vector3.zero;
for (int x = 0; x < 10; x++)
{
for (int y = 0; y < 10; y++)
{
if (grid[x, y] > 0) Instantiate(block, pos, Quaternion.identity);
else playerPos = pos;
pos += offsetY;
}
pos.z = 0f;
pos += offsetX;
}
player.position = playerPos;
oldPos = playerPos;
}
void Update () {
float dt = Time.deltaTime;
float h = 0f;
float v = 0f;
if (!inputDelayed)
{
h = Input.GetAxis("Horizontal");
v = Input.GetAxis("Vertical");
}
Vector3 pos = player.position;
int x = Mathf.FloorToInt(pos.x);
int y = Mathf.FloorToInt(pos.z);
if (h != 0)
{
nextMove = new Vector3(Mathf.Sign(h), 0f, 0f);
InputDelay();
}
if (v != 0)
{
nextMove = new Vector3(0f, 0f, Mathf.Sign(v));
InputDelay();
}
if (newPos != Vector3.zero)
{
delta += speed * dt;
if (delta >= 1.0f) delta = 1f;
if (delta > 0f)
{
player.position = Vector3.MoveTowards(oldPos, newPos, delta);
}
if (delta == 1f)
{
delta = 0f;
oldPos = newPos;
newPos = Vector3.zero;
}
}
if (delta == 0f)
{
if (nextMove != Vector3.zero)
{
pos = oldPos + nextMove;
if (grid[(int)pos.x, (int)pos.z] == 0f)
{
newPos = pos;
}
nextMove = Vector3.zero;
}
}
}
void InputDelay()
{
Invoke("EndInputDelay", inputDelay);
}
void EndInputDelay()
{
inputDelayed = false;
}
}