protected override void Initialize() { base.Initialize(); _CurrentGameState = GameState.MainMenu; GameSet = false; _Audio = new Audio(); _Audio.Initialize(); _3DEngine = new Engine3D(ref _Audio); _3DEngine.Initialize(Content); #region Text _TextList = new List<Text>(); _TextList.Add(new Text("Health: ", new Vector2(graphics.PreferredBackBufferWidth * 0.70f, graphics.PreferredBackBufferHeight * 0.75f))); _TextList.Add(new Text("Time Remaining: ", new Vector2(graphics.PreferredBackBufferWidth * 0.56f, graphics.PreferredBackBufferHeight * 0.8f))); _TextList.Add(new Text("sec ", new Vector2(graphics.PreferredBackBufferWidth * 0.85f, graphics.PreferredBackBufferHeight * 0.8f))); _Health = new Text("0", new Vector2(graphics.PreferredBackBufferWidth * 0.81f, graphics.PreferredBackBufferHeight * 0.75f)); _Timer = new Text("30", new Vector2(graphics.PreferredBackBufferWidth * 0.81f, graphics.PreferredBackBufferHeight * 0.8f)); _TextList.Add(_Health); _TextList.Add(_Timer); #endregion }
public void Update(GameTime gameTime, Audio audio) { if (!_Moving && _ChefList.Count > 0) { _Elapse += (float)gameTime.ElapsedGameTime.TotalSeconds; if (_Elapse > _Interval) { _Moving = true; Random r = new Random(); _Elapse = 0; _Interval = r.Next(_MinMove, _MaxMove); } } if (_ChefList.Count == 0 && _StartSpawn) { _Elapse += (float)gameTime.ElapsedGameTime.TotalSeconds; if (_Elapse > _RespawnTimer) { Chef c = _Chef.Clone(_Position); _ChefList.Add(c); audio.Play("Hole", "Summon"); _RespawnTimer = r.Next(_MinSpawn, _MaxSpawn); } } if (_ChefList.Count > 0 && _ChefList[0]._Strength <= 0) Clear(); }
public Engine3D(ref Audio Audio) { _Audio = Audio; }