package net.greencouchgames.ld27;

import org.andengine.entity.scene.Scene;
import org.andengine.entity.sprite.Sprite;

import tv.ouya.console.api.OuyaController;

public class s_MultiPrepare extends Scene {
	int controller;
	int controller2 = -1;
	
	Sprite bg;
	
	public s_MultiPrepare(int c) {
		controller = c;
		bg = new Sprite(0, 0, Main.spr_multiprep, Main.root.getVertexBufferObjectManager());
		attachChild(bg);
	}
	
    @Override
	protected void onManagedUpdate(final float pSecondsElapsed) {
		super.onManagedUpdate(pSecondsElapsed);
		
		if (controller2!=-1) {
			if (controller2!=controller) {
				bg.detachSelf();
				bg.dispose();
				Main.root.setCurrentScene(new s_Multi(controller,controller2));
			}
		}
		
		OuyaController.startOfFrame();
	}
}
