コード例 #1
0
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            // load particle effects
            myEffect = Content.Load<ParticleEffect>(@"EffectLibrary\CampFire");
            myEffect.LoadContent(this.Content);
            myEffect.Initialise();
            myRenderer.LoadContent(Content);

            shipCannon = new GameObject(Content.Load<Texture2D>("Sprites\\shipCannon"));

            HUD = Content.Load<SpriteFont>("Fonts\\HUD");

            meteorTexture = Content.Load<Texture2D>("Sprites\\meteoro_teste");
            //meteorTexture = Content.Load<Texture2D>("Sprites\\1");

            Debug = Content.Load<SpriteFont>("Fonts\\Score");

            Fundo = Content.Load<Texture2D>("Sprites\\background");

            shipCannon2 = new GameObject(Content.Load<Texture2D>("Sprites\\shipCannon"));

            elementoBen = new elementoBenefico(Content.Load<Texture2D>("Sprites\\insgrocha"), Content.Load<Texture2D>("Sprites\\insignacoracao"));

            shipCannon2.position = new Vector2(Window.ClientBounds.Width / 2 - shipCannon.sprite.Width / 2 + 110,
               Window.ClientBounds.Height - 100);

            shipCannon.position = new Vector2(Window.ClientBounds.Width / 2 - shipCannon.sprite.Width / 2 - 80,
                Window.ClientBounds.Height - 100);

            meteorTextureDB =
               new Color[meteorTexture.Width * meteorTexture.Height];
            meteorTexture.GetData(meteorTextureDB);
        }
コード例 #2
0
ファイル: Game1.cs プロジェクト: vitormartins1/project-meteor
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            // load particle effects
            myEffect = Content.Load<ParticleEffect>(@"EffectLibrary\CampFire");
            myEffect.LoadContent(this.Content);
            myEffect.Initialise();
            myRenderer.LoadContent(Content);

            Camera = new Camera2d();
            Camera.Pos = new Vector2(400.0f, 400.0f);

            meteoros = new Meteor(Content.Load<Texture2D>("Sprites\\meteoro_teste"));

            NaveFilho_1 = new NaveFilho(Content.Load<Texture2D>("Sprites\\StarShip_Filho"), viewportRect.Width / 2);//, 1);

            NaveFilho_2 = new NaveFilho(Content.Load<Texture2D>("Sprites\\StarShip_Filho"), viewportRect.Width / 2 + 200);//, 2);

            //NaveFilho.Velocidade *= -1;

            shipCannon = new shipCannon(Content.Load<Texture2D>("Sprites\\shipCannon"));
            shipCannon2 = new shipCannon(Content.Load<Texture2D>("Sprites\\shipCannon"));

            HUD = Content.Load<SpriteFont>("Fonts\\HUD");

            meteorTexture = Content.Load<Texture2D>("Sprites\\meteoro_teste");
            //meteorTexture = Content.Load<Texture2D>("Sprites\\1");

            Debug = Content.Load<SpriteFont>("Fonts\\Score");

            Fundo = Content.Load<Texture2D>("Sprites\\background");

            elementoBen = new elementoBenefico(Content.Load<Texture2D>("Sprites\\insgrocha"), Content.Load<Texture2D>("Sprites\\insignacoracao"));

            shipCannon2.position = new Vector2(Window.ClientBounds.Width / 2 - shipCannon.sprite.Width / 2 + 110,
               Window.ClientBounds.Height - 100);

            shipCannon.position = new Vector2(Window.ClientBounds.Width / 2 - shipCannon.sprite.Width / 2 - 65,
                Window.ClientBounds.Height - 120);

            shipCannon.center = new Vector2(shipCannon.sprite.Width / 2, shipCannon.sprite.Height / 2 - 30);
        }