Ejemplo n.º 1
0
 public void AffectTransitions()
 {
     //Affect Left transition
     if (myRoomData.myX > 0)
     {
         Room room = myBiome.GetRoom(myRoomData.myX - 1, myRoomData.myY);
         if (room != null)
         {
             myLeftTransitionTile.myNextTransition = room.myRightTransitionTile;
             myLeftTransitionTile.myNextRoomTile   = room.myRightSpawningTile;
         }
     }
     //Affect Right Transition
     if (myRoomData.myX < Data.myBiomeSideSize)
     {
         Room room = myBiome.GetRoom(myRoomData.myX + 1, myRoomData.myY);
         if (room != null)
         {
             myRightTransitionTile.myNextTransition = room.myLeftTransitionTile;
             myRightTransitionTile.myNextRoomTile   = room.myLeftSpawningTile;
         }
     }
     //Affect Bottom Transition
     if (myRoomData.myY > 0)
     {
         Room room = myBiome.GetRoom(myRoomData.myX, myRoomData.myY - 1);
         if (room != null)
         {
             myBottomTransitionTile.myNextTransition = room.myTopTransitionTile;
             myBottomTransitionTile.myNextRoomTile   = room.myTopSpawningTile;
         }
     }
     //Affect Top Transition
     if (myRoomData.myY < Data.myBiomeSideSize)
     {
         Room room = myBiome.GetRoom(myRoomData.myX, myRoomData.myY + 1);
         if (room != null)
         {
             myTopTransitionTile.myNextTransition = room.myBottomTransitionTile;
             myTopTransitionTile.myNextRoomTile   = room.myBottomSpawningTile;
         }
     }
 }
Ejemplo n.º 2
0
    public void SetRoomVisited(int aX, int aY, Biome aBiome = null)
    {
        Room room = null;

        if (aBiome == null)
        {
            room = myWorldGeneration.GetCurrentActiveBiome().GetRoom(aX, aY);
        }
        else
        {
            room = aBiome.GetRoom(aX, aY);
        }
        myVisitedRooms.Add(room);

        if (room.myRoomData.myType == RoomType.FOREST)
        {
            myRoomImages[aY * myWorldGeneration.GetWorldSideSize() + aX].color = Color.green;
        }
        else if (room.myRoomData.myType == RoomType.MOUNTAIN)
        {
            myRoomImages[aY * myWorldGeneration.GetWorldSideSize() + aX].color = new Color(0.62f, 0.32f, 0.17f);
        }
        else if (room.myRoomData.myType == RoomType.DESERT)
        {
            myRoomImages[aY * myWorldGeneration.GetWorldSideSize() + aX].color = Color.yellow;
        }
        else if (room.myRoomData.myType == RoomType.ICE)
        {
            myRoomImages[aY * myWorldGeneration.GetWorldSideSize() + aX].color = Color.white;
        }
        else if (room.myRoomData.myType == RoomType.TRANSITION)
        {
            myRoomImages[aY * myWorldGeneration.GetWorldSideSize() + aX].color = Color.gray;
        }

        if (myCurrentRoom != null)
        {
            Color col = myCurrentRoom.color;
            col.a = 1;
            myCurrentRoom.color = col;
        }
        myCurrentRoom = myRoomImages[aY * myWorldGeneration.GetWorldSideSize() + aX];
        myVisibility  = 1;
    }