Ejemplo n.º 1
0
        protected static void Render(Temple temple, World world, IntPoint pos, int[,] ground, int[,] objs)
        {
            for (var x = 0; x < temple.Size; x++) //Rendering
            {
                for (var y = 0; y < temple.Size; y++)
                {
                    if (ground[x, y] == 1)
                    {
                        var tile = world.Map[x + pos.X, y + pos.Y].Clone();
                        tile.TileId  = DarkGrass;
                        tile.ObjType = 0;
                        world.Obstacles[x + pos.X, y + pos.Y] = 0;
                        world.Map[x + pos.X, y + pos.Y]       = tile;
                    }
                    else if (ground[x, y] == 2)
                    {
                        var tile = world.Map[x + pos.X, y + pos.Y].Clone();
                        tile.TileId  = Floor;
                        tile.ObjType = 0;
                        world.Obstacles[x + pos.X, y + pos.Y] = 0;
                        world.Map[x + pos.X, y + pos.Y]       = tile;
                    }

                    if (objs[x, y] == 1)
                    {
                        var tile = world.Map[x + pos.X, y + pos.Y].Clone();
                        tile.ObjType = WallA;
                        if (tile.ObjId == 0)
                        {
                            tile.ObjId = world.GetNextEntityId();
                        }
                        world.Obstacles[x + pos.X, y + pos.Y] = 2;
                        world.Map[x + pos.X, y + pos.Y]       = tile;
                    }
                    else if (objs[x, y] == 2)
                    {
                        var tile = world.Map[x + pos.X, y + pos.Y].Clone();
                        tile.ObjType = WallB;
                        if (tile.ObjId == 0)
                        {
                            tile.ObjId = world.GetNextEntityId();
                        }
                        world.Obstacles[x + pos.X, y + pos.Y] = 2;
                        world.Map[x + pos.X, y + pos.Y]       = tile;
                    }
                    else if (objs[x, y] == 3)
                    {
                        var tile = world.Map[x + pos.X, y + pos.Y].Clone();
                        tile.ObjType = WallC;
                        if (tile.ObjId == 0)
                        {
                            tile.ObjId = world.GetNextEntityId();
                        }
                        world.Obstacles[x + pos.X, y + pos.Y] = 2;
                        world.Map[x + pos.X, y + pos.Y]       = tile;
                    }
                    else if (objs[x, y] == 4)
                    {
                        var tile = world.Map[x + pos.X, y + pos.Y].Clone();
                        tile.ObjType = Flower;
                        if (tile.ObjId == 0)
                        {
                            tile.ObjId = world.GetNextEntityId();
                        }
                        world.Obstacles[x + pos.X, y + pos.Y] = 0;
                        world.Map[x + pos.X, y + pos.Y]       = tile;
                    }
                    else if (objs[x, y] == 5)
                    {
                        var tile = world.Map[x + pos.X, y + pos.Y].Clone();
                        tile.ObjType = Grass;
                        if (tile.ObjId == 0)
                        {
                            tile.ObjId = world.GetNextEntityId();
                        }
                        world.Obstacles[x + pos.X, y + pos.Y] = 0;
                        world.Map[x + pos.X, y + pos.Y]       = tile;
                    }
                    else if (objs[x, y] == 6)
                    {
                        var tile = world.Map[x + pos.X, y + pos.Y].Clone();
                        tile.ObjType = Tree;
                        if (tile.ObjId == 0)
                        {
                            tile.ObjId = world.GetNextEntityId();
                        }
                        world.Obstacles[x + pos.X, y + pos.Y] = 0;
                        world.Map[x + pos.X, y + pos.Y]       = tile;
                    }
                }
            }
        }
Ejemplo n.º 2
0
        protected static void Render(Temple temple, World world, IntPoint pos, int[,] ground, int[,] objs)
        {
            for (var x = 0; x < temple.Size; x++) //Rendering
                for (var y = 0; y < temple.Size; y++)
                {
                    if (ground[x, y] == 1)
                    {
                        var tile = world.Map[x + pos.X, y + pos.Y].Clone();
                        tile.TileId = DarkGrass;
                        tile.ObjType = 0;
                        world.Obstacles[x + pos.X, y + pos.Y] = 0;
                        world.Map[x + pos.X, y + pos.Y] = tile;
                    }
                    else if (ground[x, y] == 2)
                    {
                        var tile = world.Map[x + pos.X, y + pos.Y].Clone();
                        tile.TileId = Floor;
                        tile.ObjType = 0;
                        world.Obstacles[x + pos.X, y + pos.Y] = 0;
                        world.Map[x + pos.X, y + pos.Y] = tile;
                    }

                    if (objs[x, y] == 1)
                    {
                        var tile = world.Map[x + pos.X, y + pos.Y].Clone();
                        tile.ObjType = WallA;
                        if (tile.ObjId == 0) tile.ObjId = world.GetNextEntityId();
                        world.Obstacles[x + pos.X, y + pos.Y] = 2;
                        world.Map[x + pos.X, y + pos.Y] = tile;
                    }
                    else if (objs[x, y] == 2)
                    {
                        var tile = world.Map[x + pos.X, y + pos.Y].Clone();
                        tile.ObjType = WallB;
                        if (tile.ObjId == 0) tile.ObjId = world.GetNextEntityId();
                        world.Obstacles[x + pos.X, y + pos.Y] = 2;
                        world.Map[x + pos.X, y + pos.Y] = tile;
                    }
                    else if (objs[x, y] == 3)
                    {
                        var tile = world.Map[x + pos.X, y + pos.Y].Clone();
                        tile.ObjType = WallC;
                        if (tile.ObjId == 0) tile.ObjId = world.GetNextEntityId();
                        world.Obstacles[x + pos.X, y + pos.Y] = 2;
                        world.Map[x + pos.X, y + pos.Y] = tile;
                    }
                    else if (objs[x, y] == 4)
                    {
                        var tile = world.Map[x + pos.X, y + pos.Y].Clone();
                        tile.ObjType = Flower;
                        if (tile.ObjId == 0) tile.ObjId = world.GetNextEntityId();
                        world.Obstacles[x + pos.X, y + pos.Y] = 0;
                        world.Map[x + pos.X, y + pos.Y] = tile;
                    }
                    else if (objs[x, y] == 5)
                    {
                        var tile = world.Map[x + pos.X, y + pos.Y].Clone();
                        tile.ObjType = Grass;
                        if (tile.ObjId == 0) tile.ObjId = world.GetNextEntityId();
                        world.Obstacles[x + pos.X, y + pos.Y] = 0;
                        world.Map[x + pos.X, y + pos.Y] = tile;
                    }
                    else if (objs[x, y] == 6)
                    {
                        var tile = world.Map[x + pos.X, y + pos.Y].Clone();
                        tile.ObjType = Tree;
                        if (tile.ObjId == 0) tile.ObjId = world.GetNextEntityId();
                        world.Obstacles[x + pos.X, y + pos.Y] = 0;
                        world.Map[x + pos.X, y + pos.Y] = tile;
                    }
                }
        }
Ejemplo n.º 3
0
        protected static void Render(Temple temple, World world, IntPoint pos, int[,] ground, int[,] objs)
        {
            XmlData dat = world.Manager.GameData;
            for (int x = 0; x < temple.Size; x++) //Rendering
                for (int y = 0; y < temple.Size; y++)
                {
                    if (ground[x, y] == 1)
                    {
                        WmapTile tile = world.Map[x + pos.X, y + pos.Y].Clone();
                        tile.TileId = dat.IdToTileType[DarkGrass];
                        tile.ObjType = 0;
                        world.Map[x + pos.X, y + pos.Y] = tile;
                    }
                    else if (ground[x, y] == 2)
                    {
                        WmapTile tile = world.Map[x + pos.X, y + pos.Y].Clone();
                        tile.TileId = dat.IdToTileType[Floor];
                        tile.ObjType = 0;
                        world.Map[x + pos.X, y + pos.Y] = tile;
                    }

                    if (objs[x, y] == 1)
                    {
                        WmapTile tile = world.Map[x + pos.X, y + pos.Y].Clone();
                        tile.ObjType = dat.IdToObjectType[WallA];
                        if (tile.ObjId == 0) tile.ObjId = world.GetNextEntityId();
                        world.Map[x + pos.X, y + pos.Y] = tile;
                    }
                    else if (objs[x, y] == 2)
                    {
                        WmapTile tile = world.Map[x + pos.X, y + pos.Y].Clone();
                        tile.ObjType = dat.IdToObjectType[WallB];
                        if (tile.ObjId == 0) tile.ObjId = world.GetNextEntityId();
                        world.Map[x + pos.X, y + pos.Y] = tile;
                    }
                    else if (objs[x, y] == 3)
                    {
                        WmapTile tile = world.Map[x + pos.X, y + pos.Y].Clone();
                        tile.ObjType = dat.IdToObjectType[WallC];
                        if (tile.ObjId == 0) tile.ObjId = world.GetNextEntityId();
                        world.Map[x + pos.X, y + pos.Y] = tile;
                    }
                    else if (objs[x, y] == 4)
                    {
                        WmapTile tile = world.Map[x + pos.X, y + pos.Y].Clone();
                        tile.ObjType = dat.IdToObjectType[Flower];
                        if (tile.ObjId == 0) tile.ObjId = world.GetNextEntityId();
                        world.Map[x + pos.X, y + pos.Y] = tile;
                    }
                    else if (objs[x, y] == 5)
                    {
                        WmapTile tile = world.Map[x + pos.X, y + pos.Y].Clone();
                        tile.ObjType = dat.IdToObjectType[Grass];
                        if (tile.ObjId == 0) tile.ObjId = world.GetNextEntityId();
                        world.Map[x + pos.X, y + pos.Y] = tile;
                    }
                    else if (objs[x, y] == 6)
                    {
                        WmapTile tile = world.Map[x + pos.X, y + pos.Y].Clone();
                        tile.ObjType = dat.IdToObjectType[Tree];
                        if (tile.ObjId == 0) tile.ObjId = world.GetNextEntityId();
                        world.Map[x + pos.X, y + pos.Y] = tile;
                    }
                }
        }
Ejemplo n.º 4
0
        protected static void Render(Temple temple, World world, IntPoint pos, int[,] ground, int[,] objs)
        {
            XmlData dat = world.Manager.GameData;

            for (int x = 0; x < temple.Size; x++) //Rendering
            {
                for (int y = 0; y < temple.Size; y++)
                {
                    if (ground[x, y] == 1)
                    {
                        WmapTile tile = world.Map[x + pos.X, y + pos.Y].Clone();
                        tile.TileId  = dat.IdToTileType[DarkGrass];
                        tile.ObjType = 0;
                        world.Map[x + pos.X, y + pos.Y] = tile;
                    }
                    else if (ground[x, y] == 2)
                    {
                        WmapTile tile = world.Map[x + pos.X, y + pos.Y].Clone();
                        tile.TileId  = dat.IdToTileType[Floor];
                        tile.ObjType = 0;
                        world.Map[x + pos.X, y + pos.Y] = tile;
                    }

                    if (objs[x, y] == 1)
                    {
                        WmapTile tile = world.Map[x + pos.X, y + pos.Y].Clone();
                        tile.ObjType = dat.IdToObjectType[WallA];
                        if (tile.ObjId == 0)
                        {
                            tile.ObjId = world.GetNextEntityId();
                        }
                        world.Map[x + pos.X, y + pos.Y] = tile;
                    }
                    else if (objs[x, y] == 2)
                    {
                        WmapTile tile = world.Map[x + pos.X, y + pos.Y].Clone();
                        tile.ObjType = dat.IdToObjectType[WallB];
                        if (tile.ObjId == 0)
                        {
                            tile.ObjId = world.GetNextEntityId();
                        }
                        world.Map[x + pos.X, y + pos.Y] = tile;
                    }
                    else if (objs[x, y] == 3)
                    {
                        WmapTile tile = world.Map[x + pos.X, y + pos.Y].Clone();
                        tile.ObjType = dat.IdToObjectType[WallC];
                        if (tile.ObjId == 0)
                        {
                            tile.ObjId = world.GetNextEntityId();
                        }
                        world.Map[x + pos.X, y + pos.Y] = tile;
                    }
                    else if (objs[x, y] == 4)
                    {
                        WmapTile tile = world.Map[x + pos.X, y + pos.Y].Clone();
                        tile.ObjType = dat.IdToObjectType[Flower];
                        if (tile.ObjId == 0)
                        {
                            tile.ObjId = world.GetNextEntityId();
                        }
                        world.Map[x + pos.X, y + pos.Y] = tile;
                    }
                    else if (objs[x, y] == 5)
                    {
                        WmapTile tile = world.Map[x + pos.X, y + pos.Y].Clone();
                        tile.ObjType = dat.IdToObjectType[Grass];
                        if (tile.ObjId == 0)
                        {
                            tile.ObjId = world.GetNextEntityId();
                        }
                        world.Map[x + pos.X, y + pos.Y] = tile;
                    }
                    else if (objs[x, y] == 6)
                    {
                        WmapTile tile = world.Map[x + pos.X, y + pos.Y].Clone();
                        tile.ObjType = dat.IdToObjectType[Tree];
                        if (tile.ObjId == 0)
                        {
                            tile.ObjId = world.GetNextEntityId();
                        }
                        world.Map[x + pos.X, y + pos.Y] = tile;
                    }
                }
            }
        }
Ejemplo n.º 5
0
        protected static void Render(Temple temple, World world, IntPoint pos, int[,] ground, int[,] objs)
        {
            var dat = world.Manager.Resources.GameData;

            for (int x = 0; x < temple.Size; x++)                  //Rendering
            {
                for (int y = 0; y < temple.Size; y++)
                {
                    if (ground[x, y] == 1)
                    {
                        var tile = world.Map[x + pos.X, y + pos.Y];
                        tile.TileId  = dat.IdToTileType[DarkGrass];
                        tile.ObjType = 0;
                        tile.UpdateCount++;
                    }
                    else if (ground[x, y] == 2)
                    {
                        var tile = world.Map[x + pos.X, y + pos.Y];
                        tile.TileId  = dat.IdToTileType[Floor];
                        tile.ObjType = 0;
                        tile.UpdateCount++;
                    }

                    if (objs[x, y] == 1)
                    {
                        var tile = world.Map[x + pos.X, y + pos.Y];
                        tile.ObjType = dat.IdToObjectType[WallA];
                        tile.ObjDesc = dat.ObjectDescs[tile.ObjType];
                        if (tile.ObjId == 0)
                        {
                            tile.ObjId = world.GetNextEntityId();
                        }
                        tile.UpdateCount++;
                    }
                    else if (objs[x, y] == 2)
                    {
                        var tile = world.Map[x + pos.X, y + pos.Y];
                        tile.ObjType = dat.IdToObjectType[WallB];
                        tile.ObjDesc = dat.ObjectDescs[tile.ObjType];
                        if (tile.ObjId == 0)
                        {
                            tile.ObjId = world.GetNextEntityId();
                        }
                        tile.UpdateCount++;
                    }
                    else if (objs[x, y] == 3)
                    {
                        var tile = world.Map[x + pos.X, y + pos.Y];
                        tile.ObjType = dat.IdToObjectType[WallC];
                        tile.ObjDesc = dat.ObjectDescs[tile.ObjType];
                        if (tile.ObjId == 0)
                        {
                            tile.ObjId = world.GetNextEntityId();
                        }
                        tile.UpdateCount++;
                    }
                    else if (objs[x, y] == 4)
                    {
                        var tile = world.Map[x + pos.X, y + pos.Y];
                        tile.ObjType = dat.IdToObjectType[Flower];
                        tile.ObjDesc = dat.ObjectDescs[tile.ObjType];
                        if (tile.ObjId == 0)
                        {
                            tile.ObjId = world.GetNextEntityId();
                        }
                        tile.UpdateCount++;
                    }
                    else if (objs[x, y] == 5)
                    {
                        var tile = world.Map[x + pos.X, y + pos.Y];
                        tile.ObjType = dat.IdToObjectType[Grass];
                        tile.ObjDesc = dat.ObjectDescs[tile.ObjType];
                        if (tile.ObjId == 0)
                        {
                            tile.ObjId = world.GetNextEntityId();
                        }
                        tile.UpdateCount++;
                    }
                    else if (objs[x, y] == 6)
                    {
                        var tile = world.Map[x + pos.X, y + pos.Y];
                        tile.ObjType = dat.IdToObjectType[Tree];
                        tile.ObjDesc = dat.ObjectDescs[tile.ObjType];
                        if (tile.ObjId == 0)
                        {
                            tile.ObjId = world.GetNextEntityId();
                        }
                        tile.UpdateCount++;
                    }
                }
            }
        }