Ejemplo n.º 1
0
 public void render(RenderHelper renderHelper)
 {
     renderHelper.renderModel(model, world, Data.diffColor, spec, amb);
 }
Ejemplo n.º 2
0
        protected override void LoadContent()
        {
            spriteBatch = new SpriteBatch(GraphicsDevice);

            Effect renderEffect = Content.Load<Effect>("3dRender");
            Model playermodel = Content.Load<Model>("shredgodpose");
            Model rampModel = Content.Load<Model>("bowl");
            desModel = Content.Load<Model>("desert");
            Texture2D sunF1 = Content.Load<Texture2D>("sun1");
            Texture2D sunF2 = Content.Load<Texture2D>("sun2");
            fly = Content.Load<Song>("flylike");

            ScoreBoard.Init(Content, graphics.GraphicsDevice.Viewport);

            SoundEffect skate = Content.Load<SoundEffect>("skate");

            var sunPT = new PlaneTexture(sunF1, new Vector3(0, -10000, 0), 8, graphics.GraphicsDevice);
            var sunFrames = new List<Texture2D>();
            sunFrames.Add(sunF1);
            sunFrames.Add(sunF2);
            Data.sun = new Sun(sunPT, sunFrames);

            var tcloudmod = Content.Load<Model>("cloud");
            var cloudMod1 = Content.Load<Model>("cloud1");
            var cloudMod2 = Content.Load<Model>("cloud2");
            var cloudMod3 = Content.Load<Model>("cloud3");

            startScreen = Content.Load<Texture2D>("startscreen");
            startScale = Math.Max(graphics.GraphicsDevice.Viewport.Width / (float)startScreen.Width, graphics.GraphicsDevice.Viewport.Height / (float)startScreen.Height);

            startNoSelect = Content.Load<Texture2D>("start");
            startSelect = Content.Load<Texture2D>("startglow");
            exitNoSelect = Content.Load<Texture2D>("exit");
            exitSelect = Content.Load<Texture2D>("exitglow");

            Texture2D[] stars = new Texture2D[3];
            stars[0] = Content.Load<Texture2D>("stars");
            stars[1] = Content.Load<Texture2D>("stars2");
            stars[2] = Content.Load<Texture2D>("stars3");

            desWorldMat = Matrix.CreateRotationX(MathHelper.PiOver2);
            desWorldMat *= Matrix.CreateScale(20);

            float width = 1f;
            Data.proj = Matrix.CreatePerspective(width, width / graphics.GraphicsDevice.Viewport.AspectRatio, .5f, 100000f);
            renderHelper = new RenderHelper(renderEffect, graphics.GraphicsDevice, Data.proj);

            var windsound = Content.Load<SoundEffect>("wind");

            var phoneTs = new List<Texture2D>();
            for (int i = 0; i < 10; i++)
                phoneTs.Add(Content.Load<Texture2D>("gameboy" + (i + 1)));

            var phoneEs = new List<Texture2D>();
            for (int i = 0; i < 4; i++)
                phoneEs.Add(Content.Load<Texture2D>("enterpass" + (i + 1)));

            var phoneIs = new List<Texture2D>();
            for (int i = 0; i < 5; i++)
                phoneIs.Add(Content.Load<Texture2D>("input" + i));

            var noB = Content.Load<SoundEffect>("no");
            var yesB = Content.Load<SoundEffect>("yes");
            var searching = Content.Load<SoundEffect>("searching");
            var found = Content.Load<SoundEffect>("found");
            var success = Content.Load<SoundEffect>("sucess");
            Data.player = new Player(new Vector3(-1.9f * 8, -100, 0), playermodel, skate, windsound, phoneTs, phoneIs, phoneEs,yesB, noB,searching,found,success);

            Data.ramp = new Ramp(rampModel, 1.14014f, new Vector3(0, 0, 0));

            var satMod = Content.Load<Model>("satellite");
            Data.sattelite = new Sattelite(satMod, new Vector3(500,-500,200));

            var cloudPos = new Vector3(0, -400, 0);
            Random rand = new Random();
            for (int i = 0; i < 30; i++)
            {
                Model cloudMod;
                double r = rand.NextDouble();

                if (r < .3)
                    cloudMod = cloudMod1;
                else if (r < .6)
                    cloudMod = cloudMod2;
                else
                    cloudMod = cloudMod3;

                var xOffset = rand.Next(-1000, 5000);
                var yOffset = rand.Next(0, 2000);
                var zOffset = rand.Next(-1000, 5000);

                var pos = cloudPos + new Vector3(xOffset, -yOffset, zOffset);
                float speed = .5f * (float)rand.NextDouble();
                float scale = 100 + 500 * (float)rand.NextDouble() * yOffset / 4000;
                Data.clouds.Add(new Cloud(cloudMod, pos, speed, scale));
            }

            var starPos = new Vector3(0, -16000, 0);
            for (int i = 0; i < 10; i++)
            {
                var xOffset = rand.Next(-10000, 10000);
                var yOffset = rand.Next(0, 4000);
                var zOffset = rand.Next(-10000, 10000);

                var pos = starPos + new Vector3(xOffset, -yOffset, zOffset);
                Data.stars.Add(new PlaneTexture(stars[0], pos, 5f, graphics.GraphicsDevice));
            }
        }
Ejemplo n.º 3
0
 public void render(RenderHelper renderHelper)
 {
     renderHelper.renderModel(model, world, Data.diffColor * .2f, Vector3.Zero, Vector3.One);
 }
Ejemplo n.º 4
0
 //public
 public void render(RenderHelper renderHelper)
 {
     renderHelper.renderModel(model, world, Vector3.One, Vector3.Zero, .4f*Vector3.One);
 }
Ejemplo n.º 5
0
 public void render(RenderHelper renderHelper)
 {
     renderHelper.renderPlaneTex(planeTex);
 }
Ejemplo n.º 6
0
 public void render(RenderHelper renderHelper)
 {
     renderHelper.renderModel(model, world, Data.diffColor, new Vector3(0.997f, 0.377f, 0.787f), .5f * new Vector3(0.997f, 0.377f, 0.787f));
 }