public static void Update(GameTime gameTime) { Item.random = new Random(); Item.timer += (float)gameTime.ElapsedGameTime.TotalSeconds; Item.timeCounter += (int)Item.timer; if (Item.timer >= 1.0F) { Item.timer = 0F; } if (Math.Abs(Item.timeCounter % timeShown) < 0.0000001) { Item.stopWatch.Start(); Item.draw = true; } if (Item.stopWatch.Elapsed.Seconds >= Item.timeInterval && Math.Abs(Item.timeCounter % timeShown) > 0.0000001) { Item.stopWatch.Stop(); Item.stopWatch.Reset(); Item.SetRandomPositions(); itemImage = ShuffleItems.Shuffle(); itemImage.LoadContent(); Item.draw = false; } }
public static void Initialise(int intervalShown) { Item.draw = false; Item.timeInterval = intervalShown; Item.random = new Random(); Item.screenHeight = ScreenManager.Instance.Dimensions.X; Item.screenWidth = ScreenManager.Instance.Dimensions.Y; Item.stopWatch = new Stopwatch(); Item.itemImage = ShuffleItems.Shuffle(); }