Exemplo n.º 1
0
        protected override void LoadContent()
        {
            heightmap = Content.Load <Texture2D>("3dMap");

            LightManager = new LightingManager(this, heightmap);

            spriteBatch = new SpriteBatch(GraphicsDevice);

            font = Content.Load <SpriteFont>("font");

            centerAxis = new cls3dAxis(this);
            map        = new LandScape(this, heightmap);

            spawn    = new Vector3[4];
            spawn[0] = new Vector3(15, 0, 15);
            spawn[1] = new Vector3(map.size.X - 15, 0, 15);
            spawn[2] = new Vector3(15, 0, map.size.Y - 15);
            spawn[3] = new Vector3(map.size.X - 15, 0, map.size.Y - 15);

            colliders         = new List <ICollider>(); //Collider list
            projectileManager = new ProjectileManager(this);

            weather = new WeatherManager(this); //Weather Manager

            tank1 = new Tank(this, Content.Load <Model>("tank/tank"), spawn[0], TankControlsKeyboard1, 1, Content.Load <Model>("TankShell/TankShell"), false, pad2, 0f);
            tank2 = new Tank(this, Content.Load <Model>("tank/tank"), spawn[3], TankControlsKeyboard2, 2, Content.Load <Model>("TankShell/TankShell"), debug, pad1, 180f);

            cameraManager = new CameraManager(this);

            //ammoPickUp = new AmmoPickup(this);
        }
Exemplo n.º 2
0
        public Skybox(Game1 game, Vector2 size)
        {
            this.game = game;
            this.map  = game.map;

            skyTexture  = game.Content.Load <Texture2D>("SkyBox/Sky1");
            WallTexture = game.Content.Load <Texture2D>("SkyBox/Sky16");

            this.size.X = size.X;
            this.size.Y = size.Y;
            height      = 100;
            roofheight  = height - height / 4;


            effect = new BasicEffect(game.GraphicsDevice);
            effect.LightingEnabled = true;
            effect.TextureEnabled  = true;


            #region Lighting
            //LIGHTING
            effect.DirectionalLight0.Enabled = true;
            effect.DiffuseColor      = game.LightManager.diffuseColor;                                //kd
            effect.SpecularColor     = game.LightManager.specularColor;                               //Specular Light  //ks
            effect.SpecularPower     = game.LightManager.specularPower;                               //Power of Specular Light //s
            effect.AmbientLightColor = game.LightManager.ambientLightColor;                           //Ia
            effect.DirectionalLight0.DiffuseColor  = game.LightManager.directionalLightDiffuseColor;  //Directional Light's Color //Id
            effect.DirectionalLight0.Direction     = game.LightManager.directionalLightDirectionSky;  //Directional light's Direction
            effect.DirectionalLight0.SpecularColor = game.LightManager.directionalLightSpecularColor; //Is
            #endregion

            radius     = size.X * 2;
            roofRadius = radius * 2;


            effect.Texture = WallTexture;
            CreateWalls();
            effect.Texture = skyTexture;
            createRoof();
        }