本文整理汇总了C#中Microsoft.Xna.Framework.Audio.Cue.Play方法的典型用法代码示例。如果您正苦于以下问题:C# Cue.Play方法的具体用法?C# Cue.Play怎么用?C# Cue.Play使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.Xna.Framework.Audio.Cue
的用法示例。
在下文中一共展示了Cue.Play方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PlayMusic
public static void PlayMusic(string name)
{
StopMusic();
cue = soundBank.GetCue(name);
cue.Play();
}
示例2: PlayBuzzer
public void PlayBuzzer()
{
fxCat.SetVolume(10f);
cue = soundBank.GetCue("Buzzer");
cue.Play();
fxCat.SetVolume(6f);
}
示例3: playLoop
static void playLoop(ref Cue cue) {
if (!cue.IsPlaying) {
StopLoops();
InitCues();
cue.Play();
}
}
示例4: TriggerBossEvent
public void TriggerBossEvent() {
mBossEvent = true;
mMusic.Pause();
mBossMusic = mSounds.GetCue( "boss_music" );
mMusicName = mBossMusic.Name;
mBossMusic.Play();
}
示例5: FieldPong
public FieldPong()
{
graphics = new GraphicsDeviceManager(this);
content = new ContentManager(Services);
graphics.PreferredBackBufferWidth = 1024;
graphics.PreferredBackBufferHeight = 768;
graphics.MinimumPixelShaderProfile = ShaderProfile.PS_2_0;
graphics.SynchronizeWithVerticalRetrace = true;
physicsSimulator = new PhysicsSimulator(new Vector2(0));
physicsSimulator.AllowedPenetration = 0.3f;
physicsSimulator.BiasFactor = 1.0f;
Services.AddService(typeof(PhysicsSimulator), physicsSimulator);
screenManager = new ScreenManager(this);
Components.Add(screenManager);
bloomProcessor = new BloomPostProcessor(this);
Components.Add(bloomProcessor);
// Uncomment this to monitor the FPS:
//fpsCounter = new FrameRateCounter(this);
//Components.Add(fpsCounter);
audioEngine = new AudioEngine("Content\\Audio\\FieldPongAudio.xgs");
waveBank = new WaveBank(audioEngine, "Content\\Audio\\Wave Bank.xwb");
soundBank = new SoundBank(audioEngine, "Content\\Audio\\Sound Bank.xsb");
backgroundMusic = soundBank.GetCue("GameSong0010 16 Bit");
backgroundMusic.Play();
}
示例6: StartMainTheme
public static void StartMainTheme()
{
if (mainTheme == null)
{
mainTheme = soundBank.GetCue("space");
mainTheme.Play();
}
}
示例7: DefenderMusic
public DefenderMusic( SoundBank sounds, AudioEngine engine ) {
mSounds = sounds;
mEngine = engine;
mMusic = sounds.GetCue( "stage_music" );
mMusicName = mMusic.Name;
mVolume = 1.0f;
mMusic.Play();
}
示例8: Tower_ZeroHealth
void Tower_ZeroHealth(object sender, EventArgs e)
{
if(heartbeatCue.IsPlaying)
heartbeatCue.Stop(AudioStopOptions.Immediate);
audioEngine.GetCategory("Drums").Stop(AudioStopOptions.Immediate);
outroCue = soundBank.GetCue("Outro");
outroCue.Play();
}
示例9: PlayerShip
public PlayerShip(Game game, Vector2 position)
{
Game = game;
_soundBank = Game.Services.GetService<SoundBank[]>();
_world = Game.Services.GetService<World>();
krypton = Game.Services.GetService<KryptonEngine>();
thrustLR = _soundBank[0].GetCue("thrust01");
thrustLR.Play();
thrustLR.Pause();
thrustUD = _soundBank[0].GetCue("thrust01");
thrustUD.Play();
thrustUD.Pause();
Position = position;
_particleRenderer = Game.Services.GetService<SpriteBatchRenderer>();
//_textures = Game.Services.GetService<Textures>();
//Loadcontentstuff
_shiptxture = Game.Content.Load<Texture2D>("player_ship");
_turretTxture = Game.Content.Load<Texture2D>(".\\guns\\turret01");
_centreVect = new Vector2(_shiptxture.Width / 2, _shiptxture.Height / 2);
ProximityBox = new Rectangle(0, 0, _shiptxture.Width+Globals.PhysBuffer, _shiptxture.Height + Globals.PhysBuffer);
//make ship fixture in for farseer
box = BodyFactory.CreateCircle(_world, ConvertUnits.ToSimUnits(_shiptxture.Width / 2), 7.0f);
box.BodyType = BodyType.Dynamic;
box.Restitution = 0.5f;
box.Friction = 0.2f;
box.FixedRotation = true;
box.LinearDamping = 0.4f;
box.Position = ConvertUnits.ToSimUnits(Position.X + _centreVect.X, Position.Y + _centreVect.Y);
box.UserData = "player";
//box.OnCollision += Collide;
box.OnSeparation += Collide;
//make light in krypton
var mLightTexture = LightTextureBuilder.CreateConicLight(Game.GraphicsDevice, 256, 2.0f);
light = CreateLights(mLightTexture,400);
var mLightTexture2 = LightTextureBuilder.CreatePointLight(Game.GraphicsDevice, 64);
light2 = CreateLights(mLightTexture2,200);
//set up thruster particle
_thrustparticle = Game.Content.Load<ParticleEffect>(".\\mercury\\thruster");
_thrustparticle.LoadContent(Game.Content);
_thrusterEmitter = (ConeEmitter)_thrustparticle[0];
//_thrusterEmitter.Initialise();
_thrusterEmitter.ParticleTexture = Game.Content.Load<Texture2D>(".\\mercury\\Particle004");
_thrustparticle.Initialise();
_particleRenderer.LoadContent(Game.Content);
//_centerVect = new Vector2(_shiptxture.Width / 2,_shiptxture.Width / 2);
currentWeapon = new Gun(Game, true, BulletsStats.Plasma01);
}
示例10: Music
public Music(SoundBank sounds, AudioEngine engine)
{
this.sounds = sounds;
this.engine = engine;
music = sounds.GetCue("stage_music");
musicName = music.Name;
volume = 1.0f;
music.Play();
}
示例11: LoadContent
internal void LoadContent()
{
//Loads the audioengine, wavebank and soundbank
engine = new AudioEngine(@"Content/Audio/GameAudio.xgs");
sound = new SoundBank(engine, @"Content/Audio/Sound Bank.xsb");
wave = new WaveBank(engine, @"Content/Audio/Wave Bank.xwb");
trackCue = sound.GetCue(songTitle);
trackCue.Play();
}
示例12: Update
public void Update() {
if( mMusic.IsStopped ) {
mMusic = mSounds.GetCue( "stage_music" );
mMusic.Play();
}
if( mBossEvent && mBossMusic.IsStopped ) {
mBossEvent = false;
}
}
示例13: Activate
public override void Activate(bool instancePreserved)
{
if (!instancePreserved)
{
if (bgm == null)
{
bgm = ((GameMain)ScreenManager.Game).AudioEM.GetCue("menuBg1");
bgm.Play();
}
}
}
示例14: Initialize
/// <summary>
/// Allows the game component to perform any initialization it needs to before starting
/// to run. This is where it can query for any required services and load content.
/// </summary>
public override void Initialize()
{
//set gameplay mode
theGame.versus = true;
//start playing background music
backgroundMusic = theGame.GameSoundBank.GetCue("H-Pizzle - Danger Zone (Kenny Loggins)");
if (theGame.soundOn)
backgroundMusic.Play();
base.Initialize();
}
示例15: PlayMusic
public void PlayMusic(string musicName)
{
if (string.IsNullOrEmpty(musicName))
{
musicName = "m_Silence";
}
if (musicName != _currentMusic.Name)
{
_currentMusic = _soundBank.GetCue(musicName);
_currentMusic.Play();
}
}