Beispiel #1
0
 public static void ChangedMode()
 {
     if (MiniMapMode)
     {
         ControlImage = ToTexture2D.IncreaseScale(MakeMiniMap(Map, player.ChunkX, player.ChunkY), 3);
     }
     else
     {
         ControlImage = Map;
     }
 }
Beispiel #2
0
        public static void PlayerMoved(int SomeX, int SomeY, bool tp)
        {
            int OldX = player.x, OldY = player.y, OldChunkX = player.ChunkX, OldChunkY = player.ChunkY;

            if (tp)
            {
                player.ChangeCoords(SomeX, SomeY, size);
            }
            else
            {
                player.ChangeCoords(player.x + SomeX, player.y + SomeY, size);
            }

            player.SetRightChunks();

            if (OldChunkX == player.ChunkX && OldChunkY == player.ChunkY)
            {
                Map.SetPixel(OldX, OldY, GameMap.GetColorInPos(OldX, OldY));
                Map.SetPixel(player.x, player.y, Color.FromArgb(255, 255, 0, 0));
                if (MiniMapMode)
                {
                    ControlImage = ToTexture2D.IncreaseScale(MakeMiniMap(Map, player.ChunkX, player.ChunkY), 3);
                }
                else
                {
                    ControlImage = Map;
                }
            }
            else
            {
                GameMap.LoadChunk(player.ChunkX, player.ChunkY);
                Map = GameMap.CreateBitmap();
                Map.SetPixel(player.x, player.y, Color.FromArgb(255, 255, 0, 0));
                PaintChunk(ref Map, player.ChunkX, player.ChunkY);
                if (MiniMapMode)
                {
                    ControlImage = ToTexture2D.IncreaseScale(MakeMiniMap(Map, player.ChunkX, player.ChunkY), 3);
                }
                else
                {
                    ControlImage = Map;
                }
            }
        }
Beispiel #3
0
 public static void StartWork(int _x, int _y, int _size, int _seed, bool _minimap)
 {
     size        = _size;
     seed        = _seed;
     MiniMapMode = _minimap;
     GameMap     = new CombinedMap(size, seed, chunksize);
     player      = new Player(_x, _y, size);
     GameMap.LoadChunk(player.ChunkX, player.ChunkY);
     Map = GameMap.CreateBitmap();
     Map.SetPixel(player.x, player.y, Color.FromArgb(255, 255, 0, 0));
     PaintChunk(ref Map, player.ChunkX, player.ChunkY);
     if (MiniMapMode)
     {
         ControlImage = ToTexture2D.IncreaseScale(MakeMiniMap(Map, player.ChunkX, player.ChunkY), 3);
     }
     else
     {
         ControlImage = Map;
     }
 }
Beispiel #4
0
 public static void LoadFullMap()
 {
     for (int i = 0; i < size; i++)
     {
         for (int j = 0; j < size; j++)
         {
             GameMap.LoadPoint(i, j);
         }
     }
     Map = GameMap.CreateBitmap();
     Map.Save(String.Format("{0}.png", seed), ImageFormat.Png);
     Map.SetPixel(player.x, player.y, Color.FromArgb(255, 255, 0, 0));
     PaintChunk(ref Map, player.ChunkX, player.ChunkY);
     if (MiniMapMode)
     {
         ControlImage = ToTexture2D.IncreaseScale(MakeMiniMap(Map, player.ChunkX, player.ChunkY), 3);
     }
     else
     {
         ControlImage = Map;
     }
 }