protected override void Initialize() { _taps = new List <Vector2>(); GameData = new GamePersistance <GameData>(this); Audio = new AudioFx(this); _currentTarget = new RenderTarget2D(Graphics.GraphicsDevice, Graphics.PreferredBackBufferWidth, Graphics.PreferredBackBufferHeight, false, SurfaceFormat.Color, DepthFormat.Depth24, 0, RenderTargetUsage.PreserveContents); _previousTarget = new RenderTarget2D(Graphics.GraphicsDevice, Graphics.PreferredBackBufferWidth, Graphics.PreferredBackBufferHeight, false, SurfaceFormat.Color, DepthFormat.Depth24, 0, RenderTargetUsage.PreserveContents); _backgroundParticles = new List <BackgroundParticle>(); for (var i = 0; i < 100; i++) { var v = new Vector2(Random.Next((int)Width), Random.Next((int)Height)); _backgroundParticles.Add(BackgroundParticle.CreateParticle(v)); //Dual Color Effect _backgroundParticles.Add(BackgroundParticle.CreateParticle(v)); } _currentComponent = this; FadeX1 = 1f; FadeX2 = 1f; _fade1Xin = false; _fade2Xin = false; base.Initialize(); }
private void Start() { cronometroGo = GameObject.FindObjectOfType <Cronometro>().gameObject; cronometroScript = cronometroGo.GetComponent <Cronometro>(); audioFx = GameObject.FindObjectOfType <AudioFx>().gameObject; audioFXDcript = audioFx.GetComponent <AudioFx>(); }
protected override void Initialize() { ApplicationViewChanged += (o, e) => { IsPaused = ApplicationView.Value != ApplicationViewState.FullScreenLandscape; }; Audio = new AudioFx(); base.Initialize(); }
private void BeginPlay() { BgFinal.SetActive(false); audioFxComp = AudioFx.Instance; carGo = Car.Instance.gameObject; SpeedRouteEngine(); MeasureScreen(); FindRoute(); }
private void Awake() { if (_instance == null) { _instance = this; } else { Destroy(gameObject); } m_FXAudio = GetComponent <AudioSource>(); }
void InicioJuego() { contenedorCallesGo = GameObject.Find("ContenedorCalles"); mCamGo = GameObject.Find("MainCamera"); // Buscar componente camara mCamComp = mCamGo.GetComponent <Camera>(); bgFinalGo = GameObject.Find("GameOver"); bgFinalGo.SetActive(false); audioFXGO = GameObject.Find("AudioFx"); audioFxScript = audioFXGO.GetComponent <AudioFx>(); cocheGo = GameObject.FindObjectOfType <Coche>().gameObject; VelocidadMotorCarretera(); MedirPantalla(); BuscoCalles(); }
protected override void Initialize() { Audio = new AudioFx(this); _currentTarget = new RenderTarget2D(Graphics.GraphicsDevice, Graphics.PreferredBackBufferWidth, Graphics.PreferredBackBufferHeight, false, SurfaceFormat.Color, DepthFormat.Depth24, 0, RenderTargetUsage.PreserveContents); _previousTarget = new RenderTarget2D(Graphics.GraphicsDevice, Graphics.PreferredBackBufferWidth, Graphics.PreferredBackBufferHeight, false, SurfaceFormat.Color, DepthFormat.Depth24, 0, RenderTargetUsage.PreserveContents); _currentComponent = this; FadeX1 = 1f; FadeX2 = 1f; _fade1Xin = false; _fade2Xin = false; base.Initialize(); }
public void PlaySoundFx(AudioFx fx) { switch(fx) { case AudioFx.BadJump: audioSource.loop = false; audioSource.clip = badJump; break; case AudioFx.GoodJump: audioSource.loop = false; audioSource.clip = goodJump; break; case AudioFx.Falling: audioSource.loop = false; audioSource.clip = falling; break; case AudioFx.Running: audioSource.loop = true; audioSource.clip = running; break; case AudioFx.KnockOut: audioSource.loop = true; audioSource.clip = knockOut; break; case AudioFx.Standing: audioSource.loop = true; audioSource.clip = standing; break; case AudioFx.Win: audioSource.loop = false; audioSource.clip = win; break; } audioSource.Play(); }
public BandMaster(): base() { Content.RootDirectory = "Content"; // Services GraphicsDeviceManager graphics = new GraphicsDeviceManager(this); graphics.PreferredBackBufferHeight = height; graphics.PreferredBackBufferWidth = width; graphics.IsFullScreen = true; IManageInput inputManager; try { inputManager = new KinectInputManager(this); } catch (Exception e) { System.Diagnostics.Debug.WriteLine(e.Message.ToString()); inputManager = new AlternativeInputManager(this); } inputManager.OnExit += OnExit; Components.Add(inputManager); Services.AddService(typeof(IManageInput), inputManager); Midi.Player player = new Midi.Player(this); Components.Add(player); Services.AddService(typeof(Midi.Player), player); AudioFx fx = new AudioFx(this); Components.Add(fx); Services.AddService(typeof(AudioFx), fx); Helpers.Game = this; // Game modes Play = new Logic.BandMasterMode(this); Pause = new Logic.PauseMenuMode(this); Menu = new Logic.MainMenuMode(this); Tutorial = new Logic.TutorialMode(this); HighScore = new Logic.HighScoreMode(this); Components.Add(Play); Components.Add(Pause); Components.Add(Menu); Components.Add(Tutorial); Components.Add(HighScore); // Graphics Graphics.SplashText splasher = new Graphics.SplashText(this); Components.Add(splasher); Services.AddService(typeof(Graphics.SplashText), splasher); Graphics.FlyingNotes notes = new Graphics.FlyingNotes(this); Components.Add(notes); Services.AddService(typeof(Graphics.FlyingNotes), notes); Components.Add(new Graphics.HandVisualizer(this)); Components.Add(new Graphics.Stage(this)); }
private void Start() { chronometerComp = Chronometer.Instance; audioFXComp = AudioFx.Instance; }