ScreenTexture1 = new BitmapTextureAtlas(1024, 1024, TextureOptions.BILINEAR_PREMULTIPLYALPHA);
ScreenTexture2 = new BitmapTextureAtlas(1024, 1024, TextureOptions.BILINEAR_PREMULTIPLYALPHA);
ScreenTexture3 = new BitmapTextureAtlas(1024, 1024, TextureOptions.BILINEAR_PREMULTIPLYALPHA);
GameActivity.engine.getTextureManager().loadTextures(ScreenTexture1, ScreenTexture2, ScreenTexture3);
Sprite Background = new Sprite(0, 0, BitmapTextureAtlasTextureRegionFactory.createFromAsset(ScreenTexture1, GameActivity.context,
"gfx/image160.png", 0, 0)) {
protected void onInitDraw(final GL10 pGL) {
super.onInitDraw(pGL);
GLHelper.enableTextures(pGL);
GLHelper.enableTexCoordArray(pGL);
GLHelper.enableDither(pGL);
}
};
scene.setBackground(new SpriteBackground(Background));
GameActivity.instance.runOnUpdateThread(new Runnable() {
public void run() { // Without runOnUpdateThread still worse
scene.attachChild(new Sprite(45, 340,
BitmapTextureAtlasTextureRegionFactory.createFromAsset(ScreenTexture2, GameActivity.context,
"gfx/image194.png", 0, 0)));
Sprite Exit = new Sprite(410, 700,
BitmapTextureAtlasTextureRegionFactory.createFromAsset(ScreenTexture2, GameActivity.context,
"gfx/image247.png", 800, 800)) {
@Override
public boolean onAreaTouched(final TouchEvent pSceneTouchEvent, final float pTouchAreaLocalX, final float pTouchAreaLocalY) {
if(pSceneTouchEvent.getAction() == TouchEvent.ACTION_UP)
GameActivity.instace.finish();
return true;
}
};
Exit.setScale(2f);
scene.attachChild(Exit);
scene.registerTouchArea(Exit);
AnimatedSprite Sound = new AnimatedSprite(313, 690,
BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(ScreenTexture3, GameActivity.context,
"gfx/image241.png", 0, 0, 2, 1)) {
protected void onInitDraw(final GL10 pGL) {
super.onInitDraw(pGL);
GLHelper.enableTextures(pGL);
GLHelper.enableTexCoordArray(pGL);
GLHelper.enableDither(pGL);
}
@Override
public boolean onAreaTouched(final TouchEvent pSceneTouchEvent, final float pTouchAreaLocalX, final float pTouchAreaLocalY) {
if(pSceneTouchEvent.getAction() == TouchEvent.ACTION_UP) {
GameActivity.sound.backgroundSound();
this.nextTile();
}
return true;
}
};
Sound.setScale(2f);
scene.attachChild(Sound);
scene.registerTouchArea(Sound);
scene.attachChild(new Sprite(23, 140,
BitmapTextureAtlasTextureRegionFactory.createFromAsset(ScreenTexture2, GameActivity.context,
"gfx/image209.png", 0, 350)));
AnimatedSprite Start = new AnimatedSprite(205, 440,
BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(ScreenTexture1, GameActivity.context,
"gfx/image0001.png", 500, 0, 1, 2)) {
protected void onInitDraw(final GL10 pGL) {
super.onInitDraw(pGL);
GLHelper.enableTextures(pGL);
GLHelper.enableTexCoordArray(pGL);
GLHelper.enableDither(pGL);
}
@Override
public boolean onAreaTouched(final TouchEvent pSceneTouchEvent, final float pTouchAreaLocalX, final float pTouchAreaLocalY) {
if(pSceneTouchEvent.getAction() == TouchEvent.ACTION_DOWN) {
this.nextTile();
}
if(pSceneTouchEvent.getAction() == TouchEvent.ACTION_UP) {
this.nextTile();
LevelChoiseScene.set();
}
return false;
}
};
scene.attachChild(Start);
scene.registerTouchArea(Start);
AnimatedSprite MoreGames = new AnimatedSprite(135, 490,
BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(ScreenTexture1, GameActivity.context,
"gfx/image0002.png", 600, 0, 1, 2)) {
@Override
public boolean onAreaTouched(final TouchEvent pSceneTouchEvent, final float pTouchAreaLocalX, final float pTouchAreaLocalY) {
if(pSceneTouchEvent.getAction() == TouchEvent.ACTION_DOWN) {
this.nextTile();
}
if(pSceneTouchEvent.getAction() == TouchEvent.ACTION_UP) {
this.nextTile();
}
return false;
}
};
scene.attachChild(MoreGames);
scene.registerTouchArea(MoreGames);
AnimatedSprite Credits = new AnimatedSprite(200, 550,
BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(ScreenTexture1, GameActivity.context,
"gfx/image0003.png", 850, 0, 1, 2)) {
@Override
public boolean onAreaTouched(final TouchEvent pSceneTouchEvent, final float pTouchAreaLocalX, final float pTouchAreaLocalY) {
if(pSceneTouchEvent.getAction() == TouchEvent.ACTION_DOWN) {
this.nextTile();
}
if(pSceneTouchEvent.getAction() == TouchEvent.ACTION_UP) {
this.nextTile();
}
return false;
}
};
scene.attachChild(Credits);
scene.registerTouchArea(Credits);
isSceneLoaded = true;
}
});
while(!isSceneLoaded) {}