Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781
[phpBB Debug] PHP Notice: in file /bbc_download.php on line 73: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /bbc_download.php on line 74: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /bbc_download.php on line 75: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /bbc_download.php on line 76: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /bbc_download.php on line 77: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /bbc_download.php on line 78: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
package splash.screen; import java.util.ArrayList; import java.util.List; import org.anddev.andengine.engine.Engine; import org.anddev.andengine.engine.camera.Camera; import org.anddev.andengine.engine.handler.IUpdateHandler; import org.anddev.andengine.engine.options.EngineOptions; import org.anddev.andengine.engine.options.EngineOptions.ScreenOrientation; import org.anddev.andengine.engine.options.resolutionpolicy.RatioResolutionPolicy; import org.anddev.andengine.entity.scene.Scene; import org.anddev.andengine.entity.scene.background.ColorBackground; import org.anddev.andengine.entity.sprite.AnimatedSprite; import org.anddev.andengine.entity.sprite.Sprite; import org.anddev.andengine.entity.util.FPSLogger; import org.anddev.andengine.input.touch.TouchEvent; import org.anddev.andengine.opengl.texture.Texture; import org.anddev.andengine.opengl.texture.TextureOptions; import org.anddev.andengine.opengl.texture.region.TextureRegion; import org.anddev.andengine.opengl.texture.region.TextureRegionFactory; import org.anddev.andengine.opengl.texture.region.TiledTextureRegion; import org.anddev.andengine.ui.activity.BaseGameActivity; import android.widget.Toast; public class Game extends BaseGameActivity { private static final int CAMERA_WIDTH = 720; private static final int CAMERA_HEIGHT = 480; private static final float DEMO_VELOCITY = 250.0f; private Camera mCamera; private Texture mTexture; private TextureRegion mPongTextureRegion; private TextureRegion mBoxTextureRegion; private TiledTextureRegion mBallTextureRegion; private List boxSpritesList = new ArrayList(); @Override public Engine onLoadEngine() { Toast.makeText(this, "Pong game", Toast.LENGTH_LONG).show(); this.mCamera = new Camera(0, 0, CAMERA_WIDTH, CAMERA_HEIGHT); return new Engine(new EngineOptions(true, ScreenOrientation.LANDSCAPE, new RatioResolutionPolicy(CAMERA_WIDTH, CAMERA_HEIGHT), this.mCamera)); } @Override public void onLoadResources() { this.mTexture = new Texture(256, 32, TextureOptions.BILINEAR_PREMULTIPLYALPHA); this.mPongTextureRegion = TextureRegionFactory.createFromAsset( this.mTexture, this, "gfx/pong.png", 0, 0); this.mBallTextureRegion = TextureRegionFactory.createTiledFromAsset( this.mTexture, this, "gfx/ball.png", 97, 0, 1, 1); this.mBoxTextureRegion = TextureRegionFactory.createFromAsset( this.mTexture, this, "gfx/box.png", 114, 0); this.mEngine.getTextureManager().loadTexture(this.mTexture); } @Override public Scene onLoadScene() { this.mEngine.registerUpdateHandler(new FPSLogger()); final Scene scene = new Scene(1); scene.setBackground(new ColorBackground(0.09804f, 0.6274f, 0.8784f)); final int centerX = (CAMERA_WIDTH - this.mPongTextureRegion.getWidth()) / 2; final int centerY = CAMERA_HEIGHT - this.mPongTextureRegion.getHeight(); final Sprite pong = new Sprite(centerX, centerY, this.mPongTextureRegion) { @Override public boolean onAreaTouched(final TouchEvent pSceneTouchEvent, final float pTouchAreaLocalX, final float pTouchAreaLocalY) { this.setPosition(pSceneTouchEvent.getX() - this.getWidth() / 2, centerY); return true; } }; final Ball ball = new Ball(centerX, 50, this.mBallTextureRegion); ball.setVelocity(DEMO_VELOCITY, DEMO_VELOCITY); pong.setScale(1); scene.getTopLayer().addEntity(pong); scene.getTopLayer().addEntity(ball); int startX = 10; for (int i = 0; i < Math.floor(CAMERA_WIDTH / 32); i++) { Sprite boxSprite = new Sprite(startX, 10, this.mBoxTextureRegion) { }; boxSpritesList.add(boxSprite); startX += 32; } for (Sprite boxSprite : boxSpritesList) { boxSprite.setScale(1); scene.getTopLayer().addEntity(boxSprite); } scene.registerTouchArea(pong); scene.setTouchAreaBindingEnabled(true); scene.registerUpdateHandler(new IUpdateHandler() { @Override public void reset() { } @Override public void onUpdate(final float pSecondsElapsed) { if (pong.collidesWith(ball)) { ball.setVelocityY(-DEMO_VELOCITY); } final List toRemoved = new ArrayList(); for (Sprite box : boxSpritesList) { if (ball.collidesWith(box)) { toRemoved.add(box); ball.setVelocityY(DEMO_VELOCITY); break; } } Game.this.runOnUpdateThread(new Runnable() { @Override public void run() { for (Sprite sprite : toRemoved) { scene.getTopLayer().removeEntity(sprite); boxSpritesList.remove(sprite); } } }); } }); return scene; } @Override public void onLoadComplete() { } private static class Ball extends AnimatedSprite { public Ball(final float pX, final float pY, final TiledTextureRegion pTextureRegion) { super(pX, pY, pTextureRegion); } @Override protected void onManagedUpdate(final float pSecondsElapsed) { if (this.mX < 0) { this.setVelocityX(DEMO_VELOCITY); } else if (this.mX + this.getWidth() > CAMERA_WIDTH) { this.setVelocityX(-DEMO_VELOCITY); } if (this.mY < 0) { this.setVelocityY(DEMO_VELOCITY); } else if (this.mY + this.getHeight() > CAMERA_HEIGHT) { this.setVelocityY(-DEMO_VELOCITY); } super.onManagedUpdate(pSecondsElapsed); } } }