public override void Update()
        {
            if (gameModel.Input.keyDown(Key.Return))
            {
                SoundsManager backgroundMusic = new SoundsManager();
                backgroundMusic.AddSound(TGCVector3.Empty, 50f, 0, "Init\\song.wav", "song", false);
                this.gameModel.SetState(new CharacterSelect(gameModel, backgroundMusic.GetSound("song")));
            }


            Scene.GetInstance().camera.rotateY(0.0005f);
        }
예제 #2
0
        public static Sound CreateSound(GameStructure i_Game, eSoundName i_eSoundType)
        {
            SoundsManager m_soundManager = i_Game.Services.GetService(typeof(SoundsManager)) as SoundsManager;
            Sound         sound          = null;

            switch (i_eSoundType)
            {
            case eSoundName.BackgroundMusic:
                sound = new Sound(i_Game, k_BackgroundMusicAsset, true, eSoundType.BackgroundMusic);
                break;

            case eSoundName.BarrierHit:
                sound = new Sound(i_Game, k_BarrierHitAsset, false, eSoundType.SoundsEffects);
                break;

            case eSoundName.EnemyGunShot:
                sound = new Sound(i_Game, k_EnemyGunShotAsset, false, eSoundType.SoundsEffects);
                break;

            case eSoundName.EnemyKill:
                sound = new Sound(i_Game, k_EnemyKillAsset, false, eSoundType.SoundsEffects);
                break;

            case eSoundName.GameOver:
                sound = new Sound(i_Game, k_GameOverAsset, false, eSoundType.SoundsEffects);
                break;

            case eSoundName.LevelWin:
                sound = new Sound(i_Game, k_LevelWinAsset, false, eSoundType.SoundsEffects);
                break;

            case eSoundName.LifeDie:
                sound = new Sound(i_Game, k_LifeDieAsset, false, eSoundType.SoundsEffects);
                break;

            case eSoundName.MenuMove:
                sound = new Sound(i_Game, k_MenuMoveAsset, false, eSoundType.SoundsEffects);
                break;

            case eSoundName.MotherShipKill:
                sound = new Sound(i_Game, k_MotherShipKillAsset, false, eSoundType.SoundsEffects);
                break;

            case eSoundName.SSGunShot:
                sound = new Sound(i_Game, k_SSGunShotAsset, false, eSoundType.SoundsEffects);
                break;
            }

            m_soundManager.SetSoundByInstanceType(sound);
            m_soundManager.AddSound(sound);
            return(sound);
        }
예제 #3
0
        public static Sound CreateSound(Game i_Game, eSoundType i_eSoundType)
        {
            SoundsManager m_soundManager = SpaceInvadersServices.GetSoundManager(i_Game);
            Sound         sound          = null;

            switch (i_eSoundType)
            {
            case eSoundType.BackgroundMusic:
                sound = new BackgroundSound(i_Game, k_BackgroundMusicAsset);
                break;

            case eSoundType.BarrierHit:
                sound = new SoundEffect(i_Game, k_BarrierHitAsset);
                break;

            case eSoundType.EnemyGunShot:
                sound = new SoundEffect(i_Game, k_EnemyGunShotAsset);
                break;

            case eSoundType.EnemyKill:
                sound = new SoundEffect(i_Game, k_EnemyKillAsset);
                break;

            case eSoundType.GameOver:
                sound = new SoundEffect(i_Game, k_GameOverAsset);
                break;

            case eSoundType.LevelWin:
                sound = new SoundEffect(i_Game, k_LevelWinAsset);
                break;

            case eSoundType.LifeDie:
                sound = new SoundEffect(i_Game, k_LifeDieAsset);
                break;

            case eSoundType.MenuMove:
                sound = new SoundEffect(i_Game, k_MenuMoveAsset);
                break;

            case eSoundType.MotherShipKill:
                sound = new SoundEffect(i_Game, k_MotherShipKillAsset);
                break;

            case eSoundType.SSGunShot:
                sound = new SoundEffect(i_Game, k_SSGunShotAsset);
                break;
            }

            m_soundManager.SetSoundByInstanceType(sound);
            m_soundManager.AddSound(sound);
            return(sound);
        }
예제 #4
0
        public Life(TGCMatrix matrix)
        {
            TgcSceneLoader loader = new TgcSceneLoader();
            TgcScene       scene  = loader.loadSceneFromFile(GlobalConcepts.GetInstance().GetMediaDir() + "MeshCreator\\Meshes\\Otros\\Vida\\Vida-TgcScene.xml");

            mesh = scene.Meshes[0];
            mesh.AutoTransform = false;
            Transform();
            timer          = new Timer();
            mesh.Effect    = TgcShaders.loadEffect(GlobalConcepts.GetInstance().GetShadersDir() + "Vida.fx");
            mesh.Technique = "Normal";
            sound          = new SoundsManager();
            sound.AddSound(GetPosition(), 50, 0, "Duke\\DameIAmGood.wav", "Vida", false);
            mesh.AutoTransform = false;
            transformation     = matrix;
        }