private void Spawn() { if (SpawnIntervall == 0) { return; } StaticObstacle obstacle = new StaticObstacle(); switch (Level) { case 1: obstacle = ObstacleFactory.GetStaticObstacle(); break; case 2: obstacle = ObstacleFactory.GetStickyObstacle(); break; case 3: obstacle = ObstacleFactory.GetStaticOrStickyObstacle(); break; case 4: obstacle = ObstacleFactory.GetRandomObstacle(); break; case 5: obstacle = ObstacleFactory.GetRandomObstacle(); break; case 6: obstacle = ObstacleFactory.GetMovingOrStickyObstacle(); break; } obstacle.Position = new Vector2(JamGame.ScreenWidth, ConveyorHitBox.Position.Y - ConveyorHitBox.Size.Height - obstacle.Hitbox.Height); Components.Add(obstacle); }