Example #1
0
        public void EventSpawnPlane()
        {
            //50:50 chance that the plane will be flying to the left or right
            if (randNumGen.Next(0, 200) < 100)
            {
                allObjects.Add(new Plane(new Vector2(viewport.Width, thePlayer.GetCentre().Y), true));
            }
            else
            {
                allObjects.Add(new Plane(new Vector2(GraphicsManager.Instance.planeMovingRight.Width * -1, thePlayer.GetCentre().Y), false));
            }

            EventManager.Instance.AddTimer(DifficultyManager.GetPlaneDelay(timeElapsed), new TimedEvent(EventSpawnPlane));
        }
Example #2
0
 public void EventSpawnCloud()
 {
     allObjects.Add(new Cloud(viewport.Bounds));
     EventManager.Instance.AddTimer(DifficultyManager.GetCloudDelay(timeElapsed, randNumGen), new TimedEvent(EventSpawnCloud));
 }
Example #3
0
 public void EventSpawnMissile()
 {
     allObjects.Add(new Missile(new Vector2(thePlayer.GetCentre().X, 500)));
     EventManager.Instance.AddTimer(DifficultyManager.GetMissileDelay(timeElapsed), new TimedEvent(EventSpawnMissile));
 }