예제 #1
0
파일: Building.cs 프로젝트: kozupi/--
        public Building(Game game, BuildingType type,Building_Manager parent, Vector3 position,float scale = 1.0f, bool rotate90 = false)
            : base(game)
        {
            addComponent(new Spatial(game, this,Vector3.Zero));
            if(rotate90)
                getComponent<Spatial>().transform = Matrix.CreateScale(scale) * Matrix.CreateRotationY((float)Math.PI/2.0f) * Matrix.CreateTranslation(position);
            else
                getComponent<Spatial>().transform = Matrix.CreateScale(scale) * Matrix.CreateTranslation(position);

            addComponent(new Collidable(game, this, CollisionType.environment, onHit, 0, 1000,parent.getComponent<Collidable>(),1400));
            Model m;
            switch (type)
            {
                case BuildingType.Bridge:
                    m = Game.Content.Load<Model>(@"Models\Buildings\Bridge");
                    break;
                case BuildingType.Building_With_Tower:
                    m = Game.Content.Load<Model>(@"Models\Buildings\Building_With_Tower");
                    break;
                case BuildingType.Building:
                    m = Game.Content.Load<Model>(@"Models\Buildings\Building_02");
                    break;
                case BuildingType.Circular_Tower:
                    m = Game.Content.Load<Model>(@"Models\Buildings\Circular_Tower");
                    break;
                case BuildingType.City_Building:
                    m = Game.Content.Load<Model>(@"Models\Buildings\City_Building");
                    break;
                case BuildingType.Iffel_Tower:
                    m = Game.Content.Load<Model>(@"Models\Buildings\Iffel_Tower");
                    break;
                case BuildingType.Pointed_Tower:
                    m = Game.Content.Load<Model>(@"Models\Buildings\Pointed_Tower");
                    break;
                case BuildingType.Skyscraper:
                    m = Game.Content.Load<Model>(@"Models\Buildings\Skyscraper");
                    break;
                case BuildingType.Tower:
                    m = Game.Content.Load<Model>(@"Models\Buildings\Tower");
                    break;
                case BuildingType.Triangle_Building:
                    m = Game.Content.Load<Model>(@"Models\Buildings\Triangle_Building");
                    break;
                case BuildingType.Warehouse:
                    m = Game.Content.Load<Model>(@"Models\Buildings\Warehouse");
                    break;
                default:
                    m = Game.Content.Load<Model>(@"Models\Buildings\Building");
                    break;
            }
            addComponent(new Drawable3D(game,this,m));
            parent.addBuilding(this);
        }
예제 #2
0
        public static void init(Game game)
        {
            managers = new Building_Manager(game);
            managers.buildBlock(Vector3.Zero);
            managers.buildBlock(new Vector3(Block.getBlockSizeBuildings().X + (5 * Block.xShift), 0, 0));
            managers.buildBlock(new Vector3(0, 0, Block.getBlockSizeBuildings().Z + (5 * Block.zShift)));

            managers.buildBlock(new Vector3(-Block.getBlockSizeBuildings().X - (5 * Block.xShift), 0, 0));
            managers.buildSpecial(new Vector3(0, 0, -Block.getBlockSizeBuildings().Z - (5 * Block.zShift)));

            managers.buildSpecial(new Vector3(-Block.getBlockSizeBuildings().X - (7 * Block.xShift), 0, -Block.getBlockSizeBuildings().Z - (7 * Block.zShift)));

            managers.buildBlock(new Vector3(Block.getBlockSizeBuildings().X + (5 * Block.xShift), 0, Block.getBlockSizeBuildings().Z + (5 * Block.zShift)));
            managers.buildBlock(new Vector3(Block.getBlockSizeBuildings().X + (5 * Block.xShift), 0, Block.getBlockSizeBuildings().Z + (5 * Block.zShift)));
        }
예제 #3
0
 public static void init(Game game)
 {
     manager = new Building_Manager(game);
     manager.buildCanyon(new Vector3(6000,0,1500));
 }