import mainScreen from '../screens/mainScreen';

const screenManager = {
  init(stage) {
    this.stage = stage;
    this.currentScreen = null;
    this.screens = {
      mainScreen,
    };

    createjs.Ticker.timingMode = createjs.Ticker.RAF;
    createjs.Ticker.addEventListener('tick', e => {
      if (this.currentScreen && this.currentScreen.tick) {
        this.currentScreen.tick(e);
      }
      this.stage.update();
    });
  },
  change(name) {
    if (this.currentScreen) {
      if (this.currentScreen.destroy) {
        this.currentScreen.destroy();
      }
      this.stage.removeChild(this.currentScreen);
    }
    this.currentScreen = new this.screens[name](this.stage.canvas.width, this.stage.canvas.height);
    this.stage.addChild(this.currentScreen);
  },
};

export default screenManager;

@@ -1,16 +1,66 @@
 import 
-m
+StartScreen from '../screens/StartScreen';%0Aimport M
 ainScree
@@ -78,17 +78,17 @@
 screens/
-m
+M
 ainScree
@@ -214,17 +214,36 @@
 %7B%0A      
-m
+StartScreen,%0A      M
 ainScree

add startScreen to screen manager