public void SetNeighbors(GridWorld world)
 {
     Up        = world.GetSpaceFromWorldIndex(UpIndex);
     UpRight   = world.GetSpaceFromWorldIndex(UpRightIndex);
     UpLeft    = world.GetSpaceFromWorldIndex(UpLeftIndex);
     Down      = world.GetSpaceFromWorldIndex(DownIndex);
     DownRight = world.GetSpaceFromWorldIndex(DownLeftIndex);
     DownLeft  = world.GetSpaceFromWorldIndex(DownRightIndex);
     Right     = world.GetSpaceFromWorldIndex(RightIndex);
     Left      = world.GetSpaceFromWorldIndex(LeftIndex);
 }
        public void StartExplosion(GridSpace space)
        {
            var spaceTransform = space.GetTransform().localPosition;

            Instantiate(
                WorldConstants.MinePrefab,
                new Vector3(spaceTransform.x, spaceTransform.y - .085f, spaceTransform.z),
                Quaternion.identity);

            StartCoroutine(Explosion(spaceTransform));
        }
Example #3
0
        public GridWorld(int size = 9)
        {
            Size         = size;
            World        = new GridSpace[Size * Size];
            GridSpace    = WorldConstants.GridSpace;
            MinimapSpace = WorldConstants.MinimapSpace;

            WorldObj = new GameObject
            {
                name = "World"
            };

            MinimapWorldObj = new GameObject
            {
                name = "MinimapWorld"
            };

            GenerateWorld();
        }
 public void StartDigging(GridSpace space)
 {
     StartCoroutine(EmptySpace(space));
 }
Example #5
0
 public InteractionHandler(GridSpace space)
 {
     Space = space;
 }