title: Flutter and Flame - Unable to move parallax effect to separate class [New to flutter]
body: <p>I'm trying to develop a little 2d platform game with flutter and flame and I already got stuck with refactoring my code....</p>
  <p>I want to put as much as possible in separate classes and also the background (parallax effect). This is a part of my main file with the effect included.</p>
  <pre><code>class PlatformGame extends BaseGame with TapDetector {
    Player _player;
  
    ParallaxComponent _parallaxComponent;
    Size screenSize;
    double tileSize;
  
    PlatformGame() {
      _parallaxComponent = ParallaxComponent(
        [
          ParallaxImage('bg/bg1.png', fill: LayerFill.height),
          ParallaxImage('bg/bg2.png'),
          ParallaxImage('bg/bg3.png'),
          ParallaxImage('bg/bg4.png'),
          ParallaxImage('bg/bg5.png'),
          ParallaxImage('bg/bg6.png', fill: LayerFill.none),
        ],
        baseSpeed: Offset(100, 0),
        layerDelta: Offset(20, 0),
      );
  
      add(_parallaxComponent);
      _player = Player();
      add(_player);
    }
  }
  </code></pre>
  <p>I tried to just create a new class called 'background' and move all the code inside there.</p>
  <pre><code>class Background extends ParallaxComponent {
    Background(List&lt;ParallaxImage&gt; images) : super(images) {
  
      //Here should be the Images for the parallax 
  
    }  
  }
  </code></pre>
  <p>But I got stuck there. No matter what im trying, I always get errors. Obviously, I'm not able to handle the constructor correctly. I've read a lot but didn't get any ideas. Can someone help me out?</p>
  <p>The Player ist in a separate class and works fine.</p>
  <p>Thanks
  Martin</p>