public override void Initialize() { m_controlMenuCollection = new List<ISprite>(); m_stateManager = StateManager.GetInstance(); new Thread( Init ) { Priority = ThreadPriority.BelowNormal }.Start(); }
public override void Initialize() { this.GameStateChanged += new GameStateEventHandler( PauseGameState_GameStateChanged ); m_stateManager = StateManager.GetInstance(); new Thread( Init ) { Priority = ThreadPriority.BelowNormal }.Start(); }
public override void Initialize() { m_stateManager = StateManager.GetInstance(); new Thread( Init ) { Priority = ThreadPriority.BelowNormal }.Start(); this.GameStateChanged += PlayerState_GameStateChanged; }
public override void Initialize() { m_audioManager = AudioManager.GetInstance(); m_audioManager.LoadSound("SongOfWaterSpray",DataReader.Load<SoundEffect>("MusicAndSoundEffect/SoundEffect/SongOfWaterSpray")); m_audioManager.LoadSong("SongOfRunningGame", DataReader.Load<Song>("MusicAndSoundEffect/Song/MusicOfRunningGameState")); m_levels = MapManager.GetInstance(); m_world = WorldManager.GetInstance(); m_sence = SenceManager.GetInstance(); m_effect = GraphicsManager.GetInstance(); m_stateManager = StateManager.GetInstance(); //m_levels.Load( "Map6" ); m_levels.Goto( "Map0" ); //m_levels.Load("Map0"); player = m_world.Player; m_renderTarget2D = new RenderTarget2D( HealGame.Game.GraphicsDevice, 800, 600, false, HealGame.Game.GraphicsDevice.PresentationParameters.BackBufferFormat, DepthFormat.Depth24Stencil8 ); m_resolveTarget = new RenderTarget2D( HealGame.Game.GraphicsDevice, 800, 600, false, HealGame.Game.GraphicsDevice.PresentationParameters.BackBufferFormat, DepthFormat.Depth24Stencil8); //DataReader.Load<Effect>("Effect/Blur"); }
public override void Initialize() { m_curChildState = ChildState.ShowTeamlogoState; m_stateManager = StateManager.GetInstance(); m_showStoryTexPackaging = new ShowStoryTexPackaging(); m_showStoryTexPackaging.Initialize(); #region Initialize ScenceSprites #region Initialize the teamlogo m_teamlogo = new ScenceSprite() { TextureImage = DataReader.Load<Texture2D>( "Texture/Menu/Teamlogo/teamlogo" ), DestRect = new Rectangle( 0, 0, HealGame.Game.GraphicsDevice.Viewport.Width, HealGame.Game.GraphicsDevice.Viewport.Height ), CurAlpha = 0.1f, FlashInterval = 0.008f, Visible = true, }; m_teamlogo.TColor = new Color( new Vector4( 255, 255, 255, m_teamlogo.CurAlpha ) ); m_teamlogo.SourceRect = new Rectangle( 0, 0, m_teamlogo.TextureImage.Width, m_teamlogo.TextureImage.Height ); #endregion #region Initialize the respectBackground m_respectBackground = new ScenceSprite() { TextureImage = DataReader.Load<Texture2D>( "Texture/Menu/RespectShow/b_0" ), DestRect = new Rectangle( 0, 0, HealGame.Game.GraphicsDevice.Viewport.Width, HealGame.Game.GraphicsDevice.Viewport.Height ), CurAlpha = 0.0f, FlashInterval = 0.005f, Visible = true, }; m_respectBackground.TColor = new Color( new Vector4( 255, 255, 255, m_respectBackground.CurAlpha ) ); m_respectBackground.SourceRect = new Rectangle( 0, 0, m_respectBackground.TextureImage.Width, m_respectBackground.TextureImage.Height ); #endregion #region Initialize the respect word_1 m_word_1 = new ScenceSprite() { TextureImage = DataReader.Load<Texture2D>( "Texture/Menu/RespectShow/b_1" ), DestRect = new Rectangle( 0, 0, HealGame.Game.GraphicsDevice.Viewport.Width, HealGame.Game.GraphicsDevice.Viewport.Height ), CurAlpha = 0.2f, FlashInterval = 0.005f, Visible = true, }; m_word_1.TColor = new Color( new Vector4( 255, 255, 255, m_word_1.CurAlpha ) ); m_word_1.SourceRect = new Rectangle( 0, 0, m_word_1.TextureImage.Width, m_word_1.TextureImage.Height ); #endregion #region Initialize the respect word_2 m_word_2 = new ScenceSprite() { TextureImage = DataReader.Load<Texture2D>( "Texture/Menu/RespectShow/b_2" ), DestRect = new Rectangle( 0, 0, HealGame.Game.GraphicsDevice.Viewport.Width, HealGame.Game.GraphicsDevice.Viewport.Height ), CurAlpha = 0.005f, FlashInterval = 0.005f, Visible = true, }; m_word_2.TColor = new Color( new Vector4( 255, 255, 255, m_word_2.CurAlpha ) ); m_word_2.SourceRect = new Rectangle( 0, 0, m_word_2.TextureImage.Width, m_word_2.TextureImage.Height ); #endregion m_showTeamlogoCollection = new List<ISprite>(); m_showRespectCollection = new List<ISprite>(); #region Add the components to the m_showTeamlogoCollection m_showTeamlogoCollection.Add(m_teamlogo); #endregion #region Add the components to the m_showRespectCollection m_showRespectCollection.Add( m_respectBackground ); m_showRespectCollection.Add( m_word_1); m_showRespectCollection.Add( m_word_2 ); #endregion #endregion }
internal static StateManager GetInstance() { if (m_instance == null) { m_instance = new StateManager(); } return m_instance; }
public override void Initialize() { m_audioManager = AudioManager.GetInstance(); m_audioManager.LoadSong( "SongOfMainMenuGameState", DataReader.Load<Song>( "MusicAndSoundEffect/Song/MusicOfMenuState" ) ); //m_audioManager.PlaySong( "SongOfMainMenuGameState", true ); //m_audioManager.LoadSound("def", DataReader.Load<SoundEffect>("")); //m_audioManager.PlaySong( "SongOfMainMenuGameState", true ); //m_audioManager.StopSong(); //m_audioManager.FadeSong(1,new TimeSpan(0,0,1)); m_curChildState = ChildState.BeginState; m_beginStateCollection = new List<ISprite>(); m_gameLogoDisappearStateCollection = new List<ISprite>(); m_startMenuShowStateCollection = new List<ISprite>(); m_zoomInBackgroundStateCollection = new List<ISprite>(); m_capsuleOnTargetStateCollection = new List<ISprite>(); m_distortionStateCollection = new List<ISprite>(); m_effect = GraphicsManager.GetInstance(); m_stateManager = StateManager.GetInstance(); #region Initialize the tv pictures m_tvPicture_1 = new DButton( DButton.DButtonState.Idle, "Texture/Menu/TVPicture/TVPicture_1", SpriteManager.SpriteBatch, "TVPicture_1" ); m_tvPicture_2 = new DButton( DButton.DButtonState.Idle, "Texture/Menu/TVPicture/TVMessy _3", SpriteManager.SpriteBatch, "TVPicture_2" ); m_tvPicture_3 = new DButton( DButton.DButtonState.Idle, "Texture/Menu/TVPicture/TVPicture_3", SpriteManager.SpriteBatch, "TVPicture_3" ); m_tvPicture_4 = new DButton( DButton.DButtonState.Idle, "Texture/Menu/TVPicture/TVMessy _2", SpriteManager.SpriteBatch, "TVPicture_4" ); m_tvPicture_5 = new DButton( DButton.DButtonState.Idle, "Texture/Menu/TVPicture/TVMessy _1", SpriteManager.SpriteBatch, "TVPicture_5" ); m_tvPicture_6 = new DButton( DButton.DButtonState.Idle, "Texture/Menu/TVPicture/TVPicture_6", SpriteManager.SpriteBatch, "TVPicture_6" ); m_tvPicture_7 = new DButton( DButton.DButtonState.Idle, "Texture/Menu/TVPicture/TVPicture_7", SpriteManager.SpriteBatch, "TVPicture_7" ); m_tvMessey_1 = new DButton( DButton.DButtonState.Idle, "Texture/Menu/TVPicture/TVMessy _1", SpriteManager.SpriteBatch, "TVMessy _1" ); m_tvMessey_2 = new DButton( DButton.DButtonState.Idle, "Texture/Menu/TVPicture/TVMessy _2", SpriteManager.SpriteBatch, "TVMessy _2" ); m_tvMessey_3 = new DButton( DButton.DButtonState.Idle, "Texture/Menu/TVPicture/TVMessy _3", SpriteManager.SpriteBatch, "TVMessy _3" ); m_tvPictureList = new List<DButton>(); //m_tvMesseyList = new List<DButton>(); m_tvPictureList.Add( m_tvPicture_1 ); m_tvPictureList.Add( m_tvPicture_2 ); m_tvPictureList.Add( m_tvPicture_3 ); m_tvPictureList.Add( m_tvPicture_4 ); m_tvPictureList.Add( m_tvPicture_5 ); m_tvPictureList.Add( m_tvPicture_6 ); m_tvPictureList.Add( m_tvPicture_7 ); m_tvPictureList.Add( m_tvMessey_1 ); m_tvPictureList.Add( m_tvMessey_2 ); m_tvPictureList.Add( m_tvMessey_3 ); #endregion m_logo = new ScenceSprite(); m_logo.TextureImage = DataReader.Load<Texture2D>( "Texture/Menu/CommonScene/GameLogo" ); m_startString = new ScenceSprite(); m_startString.TextureImage = DataReader.Load<Texture2D>( "Texture/Menu/CommonScene/press_0" ); m_buttonPackaging = new MainMenuButtonPackaging( SpriteManager.SpriteBatch ); m_background = new ScenceSprite(); m_background.TextureImage = DataReader.Load<Texture2D>( "Texture/Menu/CommonScene/Background" ); m_foreground = new ScenceSprite(); m_foreground.TextureImage = DataReader.Load<Texture2D>( "Texture/Menu/CommonScene/Foreground" ); m_backgroundMist = new ScenceSprite(); m_backgroundMist.TextureImage = DataReader.Load<Texture2D>( "Texture/Menu/CommonScene/Mist" ); m_ufoLight = new ScenceSprite(); m_ufoLight.TextureImage = DataReader.Load<Texture2D>( "Texture/Menu/CommonScene/UFOLight" ); #region Initialize the statics player m_staticsDarkPlayer = new ScenceSprite(); m_staticsDarkPlayer.TextureImage = DataReader.Load<Texture2D>( "Texture/Menu/CommonScene/DarkPlayer" ); #region Initial the glowing player m_staticsGlowingPlayer = new ScenceSprite() { TextureImage = DataReader.Load<Texture2D>( "Texture/Menu/CommonScene/GlowingPlayer" ), TargetOffset = new Vector2( 2000, 3000 ), DestRect = new Rectangle( 0, 0, HealGame.Game.GraphicsDevice.Viewport.Width, HealGame.Game.GraphicsDevice.Viewport.Height ), Visible = true, TColor = Color.White }; m_staticsGlowingPlayer.SourceRect = new Rectangle( 0, 0, m_staticsGlowingPlayer.TextureImage.Width, m_staticsGlowingPlayer.TextureImage.Height ); #endregion #endregion #region Initialize the tips button "Enter" m_tipsButton = new ScenceSprite() { TextureImage = DataReader.Load<Texture2D>( "Texture/Menu/CommonScene/press_1" ), Position = new Vector2( 420, 125 ), Visible = true, TColor = Color.White }; m_tipsButton.DestRect = new Rectangle( (int)m_tipsButton.Position.X, (int)m_tipsButton.Position.Y, (int)( m_tipsButton.TextureImage.Width * 0.25 ), (int)( m_tipsButton.TextureImage.Height * 0.25 ) ); m_tipsButton.SourceRect = new Rectangle( 0, 0, m_tipsButton.TextureImage.Width, m_tipsButton.TextureImage.Height ); #endregion InitLogic(); #region Add the components to the m_beginStateCollection m_beginStateCollection.Add( m_background ); m_beginStateCollection.Add( m_foreground ); m_beginStateCollection.Add( m_backgroundMist ); m_beginStateCollection.Add( m_staticsDarkPlayer ); m_beginStateCollection.Add( m_logo ); m_beginStateCollection.Add( m_startString ); #endregion #region Add the components to the m_gameLogoDisappearStateCollection m_gameLogoDisappearStateCollection.Add( m_background ); m_gameLogoDisappearStateCollection.Add( m_foreground ); m_gameLogoDisappearStateCollection.Add( m_staticsDarkPlayer ); m_gameLogoDisappearStateCollection.Add( m_backgroundMist ); #endregion #region Add the components to the m_startMenuShowStateCollection m_startMenuShowStateCollection.Add( m_background ); m_startMenuShowStateCollection.Add( m_foreground ); m_startMenuShowStateCollection.Add( m_buttonPackaging ); m_startMenuShowStateCollection.Add( m_ufoLight ); m_startMenuShowStateCollection.Add( m_staticsDarkPlayer ); m_startMenuShowStateCollection.Add( m_backgroundMist ); #endregion #region Add the components to the m_zoomInBackgroundStateCollection m_zoomInBackgroundStateCollection.Add( m_background ); m_zoomInBackgroundStateCollection.Add( m_foreground ); m_zoomInBackgroundStateCollection.Add( m_ufoLight ); m_zoomInBackgroundStateCollection.Add( m_staticsDarkPlayer ); m_zoomInBackgroundStateCollection.Add( m_backgroundMist ); #endregion #region Add the components to the m_capsuleOnTargetStateCollection m_capsuleOnTargetStateCollection.Add( m_background ); foreach( var a in m_tvPictureList ) { m_capsuleOnTargetStateCollection.Add( a ); } m_capsuleOnTargetStateCollection.Add( m_foreground ); m_capsuleOnTargetStateCollection.Add( m_tipsButton ); m_capsuleOnTargetStateCollection.Add( m_ufoLight ); m_capsuleOnTargetStateCollection.Add( m_staticsGlowingPlayer ); m_capsuleOnTargetStateCollection.Add( m_backgroundMist ); #endregion #region Add the components to the m_distortionStateCollection m_distortionStateCollection.Add( m_background ); foreach( var a in m_tvPictureList ) { m_distortionStateCollection.Add( a ); } m_distortionStateCollection.Add( m_foreground ); m_distortionStateCollection.Add( m_backgroundMist ); m_distortionStateCollection.Add( m_staticsGlowingPlayer ); #endregion this.GameStateChanged += new GameStateEventHandler( MainMenuGameState_GameStateChanged ); }
/// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> protected override void LoadContent() { // Create a new SpriteBatch, which can be used to draw textures. spriteBatch = new SpriteBatch(GraphicsDevice); SpriteManager.SpriteBatch = spriteBatch; InstanceManager.InitializeManagers(); m_state = StateManager.GetInstance(); m_state.Initialize(); Console.WriteLine(DateTime.Now - m_time); }