Beispiel #1
0
 public Interior(InteriorNames interiorname, Game _game, Vector2 Position, Vector2 _size, RoomDoorPositionsInfo DoorPositions, RoomAmbiance ambient)
 {
     switch (interiorname)
     {
         case InteriorNames.Empty:
             break;
         case InteriorNames.Cave:
             createCave(_game, Position, _size, DoorPositions, ambient);
             break;
     }
 }
Beispiel #2
0
        private void createCave(Game _game, Vector2 Position, Vector2 _size, RoomDoorPositionsInfo DoorPositions, RoomAmbiance ambient)
        {
            CaveGenerator cavegen = new CaveGenerator();
            _solidGrid = cavegen.GenerateCave(_size, DoorPositions);

            for (int x = 1; x < _solidGrid.GetLength(0) - 1; x++)
            {
                for (int y = 1; y < _solidGrid.GetLength(1) - 1; y++)
                {
                    if (_solidGrid[x, y] == true)
                    {

                        bool solid = false;
                        foreach (var coord in Globals.GetMoore(x, y))
                        {
                            if (_solidGrid[coord.Item1, coord.Item2] == false) solid = true;
                        }
                        if (solid == true)
                        {
                            var solidblock = new SolidSmallBlock01(_game, new Vector2(Position.X + (x * Globals.SmallGridSize.X),
                                                                              Position.Y + (y * Globals.SmallGridSize.Y)), ambient.RoomColour
                                                                              , MaterialsStats.Rock01);
                            DestructibleWalls.Add(solidblock);
                        }
                        else
                        {
                            var wallblock = new SmallBlock01(_game, new Vector2(Position.X + (x * Globals.SmallGridSize.X),
                                                                              Position.Y + (y * Globals.SmallGridSize.Y)), ambient.RoomColour);
                            _interiorSpriteList.Add(wallblock);
                        }
                    }
                }
            }
        }
Beispiel #3
0
 public Hulk(Game _game, Vector2 Position, Vector2 _size,RoomAmbiance amb)
 {
     _hulksprite = new HulkSprite(_game,Position,amb.RoomColour,_size);
 }