@Override protected void onStart() { super.onStart(); em = new EntityManager(); MetaEntity.defaultEntityManager = em; Game game = new Game(em); /** create the surface + thread */ SurfaceViewThePit surfaceView = new SurfaceViewThePit(this, game); RenderSystemSimpleDrawable renderSystem = new RenderSystemSimpleDrawable(em, surfaceView, game); MainRunThread runGameThread = new MainRunThread(this, em, surfaceView, renderSystem); runGameThread.loadAllCoreSubSystems(); // runGameThread.setGameResult( gameToStart ); SubsystemTouchHandler systemTh = new SubsystemTouchHandler(em); runGameThread.orderedSubSystems.addLast(systemTh); // MUST be before the Collision Subsystem TouchListenerPlayerMovement thv = new TouchListenerPlayerMovement(systemTh); SubsystemGhosts systemGhosts = new SubsystemGhosts(em, game); runGameThread.orderedSubSystems.addLast(systemGhosts); SubsystemMovementAndCollision systemCollision = new SubsystemMovementAndCollision(em, renderSystem); runGameThread.orderedSubSystems.addLast(systemCollision); SubsystemLighting systemLighting = new SubsystemLighting(em, game); runGameThread.orderedSubSystems.addLast(systemLighting); SubsystemTriggers systemTriggers = new SubsystemTriggers(this, em, game); runGameThread.orderedSubSystems.addLast(systemTriggers); surfaceView.setOnTouchListener(thv); surfaceView.thread = runGameThread; Log.i(getClass().getSimpleName(), "initialized thread and surface"); /** * Finally ... tell the game that the ES is now valid, it's ship reference is OK, and it can do * game-setup */ game.preSetupGame(); renderSystem.shiftCanvasToKeepPositionOnScreen( new CPosition( game.initialPlayerLocation.x, game.initialPlayerLocation.y, game.mazeCellWidth, game.mazeCellHeight)); // turn off the window's title bar requestWindowFeature(Window.FEATURE_NO_TITLE); getWindow() .setFlags( WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); setContentView(surfaceView); }