Exemplo n.º 1
0
 public void linkTeleporters(Teleporter tp2)
 {
     LinkedTeleporter = tp2;
     tp2.LinkedTeleporter = this;
 }
Exemplo n.º 2
0
 public void AddObject(System.Type type)
 {
     if (type == typeof(Platform))
         InitializeObject(new Platform(CurrentLevel, 1, 1, position: Crosshair.Position));
     else if (type == typeof(PlayerCheckpoint)) {
         if (_selectedObject != null && _selectedObject is PlayerCheckpoint) {
             CurrentLevel.FirstCheckpoint = (PlayerCheckpoint)_selectedObject;
         } else {
             InitializeObject(new PlayerCheckpoint(CurrentLevel));
         }
     } else if (type == typeof(DeadlyPlatform))
         InitializeObject(new DeadlyPlatform(CurrentLevel, 1, 1, position: Crosshair.Position));
     else if (type == typeof(Shower))
         InitializeObject(new Shower(CurrentLevel, 1, 1, position: Crosshair.Position));
     else if (type == typeof(Teleporter)) {
         Teleporter tp1 = new Teleporter(CurrentLevel, Crosshair.Position);
         Teleporter tp2 = new Teleporter(CurrentLevel, Crosshair.Position);
         InitializeObject(tp1);
         InitializeObject(tp2);
         tp1.Position += new Vector2(30, 0);
         tp1.linkTeleporters(tp2);
     } else if (type == typeof(Trampoline))
         InitializeObject(new Trampoline(CurrentLevel, 1, 1, Crosshair.Position, Color.White, new Vector2(1, 2)));
     else if (type == typeof(ColorPickup))
         InitializeObject(new ColorPickup(CurrentLevel, Color.Green));
     else if (type == typeof(DisappearingPlatform))
         InitializeObject(new DisappearingPlatform(CurrentLevel, Crosshair.Position, 1, 1, Color.White, 1, 1));
     else if (type == typeof(LevelFinish))
         InitializeObject(new LevelFinish(CurrentLevel, Crosshair.Position));
     else if (type == typeof(JumpResetter))
         InitializeObject(new JumpResetter(CurrentLevel));
     else if (type == typeof(TextBalloon)) {
         if (_selectedObject != null) {
             InitializeObject(new TextBalloon(CurrentLevel, _selectedObject, new Vector2(0, 0), 18));
             ((TextBalloon)_selectedObject).Text.Add("Sample Text!");
             ((TextBalloon)_selectedObject).Start();
         }
     } else if (type == typeof(MovingPlatform))
         InitializeObject(new MovingPlatform(CurrentLevel, Crosshair.Position, 1, 1, Color.White));
 }