コード例 #1
0
 public Bombard(Model model, Terrain terrain, 
     Texture2D tex, Camera camera, HUD hud, float milliseconds, Effect effect, Texture2D smokeTexture, Audio audio)
 {
     this.texture = tex;
     this.model = model;
     this.camera = camera;
     this.hud = hud;
     this.terrain = terrain;
     this.milliseconds = milliseconds;
     this.effect = effect;
     this.smokeTexture = smokeTexture;
     this.audio = audio;
     Vector3 rand = RandomPosition();
 }
コード例 #2
0
        protected override void LoadContent()
        {
            // Load resources to play the intro video
            LoadVideoResources();

            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            font = Content.Load<SpriteFont>(@"Fonts\GameFont");
            randomNumberGenerator = new Random();
            audio = new Audio(this);

            // The font, the random number generator and audio need to be accessible from every where
            Services.AddService(typeof(SpriteFont), font);
            Services.AddService(typeof(Random), randomNumberGenerator);
            Services.AddService(typeof(Audio), audio);
        }
コード例 #3
0
 private void StartBackgroundMusic()
 {
     audio = (Audio)Game.Services.GetService(typeof(Audio));
     audio.PlayBackgroundMusic("QuickSilver");
 }