/// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            BoundingRenderer.InitializeGraphics(graphics.GraphicsDevice);
            spriteBatch = new SpriteBatch(GraphicsDevice);
            player.LoadModel(Content, "Ship");
            player.rotation   = new Vector3(0f, 0f, 0f);
            player.position.X = 0;
            player.position.Y = 0;
            player.position.Z = 0;
            player.scale      = 0.1f;
            rock.LoadModel(Content, "Meteor");
            rock.scale    = 0.1f;
            rock.position = new Vector3(25, 60, -50);
            for (int c = 0; c < walls.Length; c++)
            {
                walls[c] = new basicCuboid(GraphicsDevice);
                walls[c].LoadContent(Content, "WallTexture");
                walls[c].scale = new Vector3(5, 30, 60);
                if (c < 5)
                {
                    walls[c].SetUpVertices(new Vector3(-70, 0, 60 * (c + 1)));
                }
                else if (c < 10)
                {
                    walls[c].SetUpVertices(new Vector3(-70, 0, -60 * (c - 4)));
                }
                else
                {
                    walls[c].scale = new Vector3(60, 30, 5);
                    walls[c].SetUpVertices(new Vector3(-70 + (c - 10) * 60, 0, -300));
                }
            }

            door = new basicCuboid(GraphicsDevice);
            door.LoadContent(Content, "WallTexture");
            door.scale = new Vector3(5, 30, 60);
            door.SetUpVertices(new Vector3(-70, 0, 0));
            TriggerBoxDoorOpen = new BoundingBox(new Vector3(-95, 0, 0), new Vector3(-
                                                                                     45, 10, 60));
            TriggerBoxRockFall = new BoundingBox(new Vector3(-5, -5, -55), new
                                                 Vector3(55, 5, -45));
            sunlight.diffuseColor  = new Vector3(10);
            sunlight.specularColor = new Vector3(1f, 1f, 1f);
            sunlight.direction     = Vector3.Normalize(new Vector3(1.5f, -1.5f, -1.5f));

            //music
            this.BGM = Content.Load <Song>("GameofBlades-TrailsofCold SteelOST");
            MediaPlayer.Play(BGM);
            //the following line will also loop the song
            MediaPlayer.IsRepeating        = true;
            MediaPlayer.MediaStateChanged += MediaPlayer_MediaStateChanged;
        }
Exemple #2
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            BoundingRenderer.InitializeGraphics(graphics.GraphicsDevice);
            spriteBatch = new SpriteBatch(GraphicsDevice);
            player.LoadModel(Content, "Ship");
            player.rotation   = new Vector3(1.5f, 0f, 0f);
            player.position.X = 0;
            player.position.Y = 0;
            player.position.Z = 0;
            player.scale      = 0.1f;
            //player.collisionOffset = new Vector3(0, 100.0f, 0);
            rock.LoadModel(Content, "Meteor");
            rock.scale    = 0.1f;
            rock.position = new Vector3(25, 60, -50);
            for (int c = 0; c < walls.Length; c++)
            {
                walls[c] = new basicCuboid(GraphicsDevice);
                walls[c].LoadContent(Content, "WallTexture");
                walls[c].scale = new Vector3(5, 30, 60);
                if (c < 5)
                {
                    walls[c].SetUpVertices(new Vector3(-70, 0, 60 * (c + 1)));
                }
                else if (c < 10)
                {
                    walls[c].SetUpVertices(new Vector3(-70, 0, -60 * (c - 4)));
                }
                else
                {
                    walls[c].scale = new Vector3(60, 30, 5);
                    walls[c].SetUpVertices(new Vector3(-70 + (c - 10) * 60, 0, -300));
                }
            }

            door = new basicCuboid(GraphicsDevice);
            door.LoadContent(Content, "WallTexture");
            door.scale = new Vector3(5, 30, 60);
            door.SetUpVertices(new Vector3(-70, 0, 0));
            TriggerBoxDoorOpen = new BoundingBox(new Vector3(-95, 0, 0), new Vector3(-
                                                                                     45, 10, 60));
            TriggerBoxRockFall = new BoundingBox(new Vector3(-5, -5, -55), new
                                                 Vector3(55, 5, -45));
            sunlight.diffuseColor  = new Vector3(10);
            sunlight.specularColor = new Vector3(1f, 1f, 1f);
            sunlight.direction     = Vector3.Normalize(new Vector3(1.5f, -1.5f, -1.5f));
        }