/// <summary> /// Allows the game to perform any initialization it needs to before starting to run. /// This is where it can query for any required services and load any non-graphic /// related content. Calling base.Initialize will enumerate through any components /// and initialize them as well. /// </summary> protected override void Initialize() { // TODO: Add your initialization logic here base.Initialize(); Arduino.Initialize(); timer = new Timer(); scoreCounter = new OverallScoreCounter(); renderTarget = new RenderTarget2D(this.GraphicsDevice, 3840, 2160); soundEffects = new SoundEffects(); outerWorks = new OuterWorks(); gearCounter = new GearCounter(); endgameCounter = new EndgameCounter(); rpCounter = new RPCounter(); }
/// <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); Timer.Load(Content); OverallScoreCounter.Load(Content); SoundEffects.Load(Content); OuterWorks.Load(Content); GearCounter.Load(Content); EndgameCounter.Load(Content); RPCounter.Load(Content); titleFont = Content.Load <SpriteFont>("titlefont"); bigTitleFont = Content.Load <SpriteFont>("titlefontsuper"); logo = Content.Load <Texture2D>("steamhold4"); background = Content.Load <Texture2D>("background"); // TODO: use this.Content to load your game content here }
public void Update(GameTime gameTime, SoundEffects soundEffects) { this.gameTime = gameTime; if (inMatch) { // currently in true seconds since match start counting up secondsToDisplay = (float)gameTime.TotalGameTime.TotalSeconds - timeMatchStarted; if (secondsToDisplay <= 15) { if (matchJustStarted) { soundEffects.addToQueue("autoStart"); matchJustStarted = false; } // auto auto = true; teleop = false; endgame = false; secondsToDisplay = 15 - secondsToDisplay; } else if (secondsToDisplay <= 119) { if (!teleop) { soundEffects.addToQueue("teleopStart"); } // teleop auto = false; teleop = true; endgame = false; secondsToDisplay -= 15; secondsToDisplay = 135 - secondsToDisplay; } else if (secondsToDisplay <= 150) { // endgame if (!endgame) { soundEffects.addToQueue("endgameStart"); } auto = false; teleop = false; endgame = true; secondsToDisplay -= 15; secondsToDisplay = 135 - secondsToDisplay; } else if (secondsToDisplay > 150) { if (endgame) { soundEffects.addToQueue("matchEnd"); } // match over auto = false; teleop = false; endgame = false; secondsToDisplay = 0; inMatch = false; } timeStr = ((int)secondsToDisplay).ToString(); } else { timeStr = "0"; } }
public void Reset(SoundEffects soundEffects) { inMatch = false; soundEffects.addToQueue("faultSound"); }