I'm a new developer so excuse my code

I trying to make a simple game, where i have a box grid and a player tile that can bump into other tiles.
I have made a function that's add tiles (shortened for reading purposes):
Using java Syntax Highlighting
- private Sprite tile;
- private Body tilebody;
Parsed in 0.030 seconds, using GeSHi 1.0.8.4
Using java Syntax Highlighting
- public void onLoadResources() {
- this.mTile0Texture = new BitmapTextureAtlas(32,32, TextureOptions.BILINEAR_PREMULTIPLYALPHA);
- this.mTile0TextureRegion = BitmapTextureAtlasTextureRegionFactory.createFromAsset(this.mTile0Texture, this, "tile_0.png", 0, 0);
- }
Parsed in 0.030 seconds, using GeSHi 1.0.8.4
Using java Syntax Highlighting
- private void addTile(final float pX, final float pY, final Integer pValue) {
- switch (pValue) {
- case 0:
- tile = new Sprite(pX, pY, this.mTile0TextureRegion);
- tilebody = PhysicsFactory.createBoxBody(this.mPhysicsWorld, tile, BodyType.StaticBody, FIXTURE_DEF);
- this.mScene.attachChild(tile);
- this.mPhysicsWorld.registerPhysicsConnector(new PhysicsConnector(tile, tilebody, true, true));
- break;
- }
- }
Parsed in 0.034 seconds, using GeSHi 1.0.8.4
And the player tile:
Using java Syntax Highlighting
- private Body mPlayerBody;
- private Sprite mPlayer;
Parsed in 0.034 seconds, using GeSHi 1.0.8.4
Using java Syntax Highlighting
- public void onLoadResources() {
- this.mPlayerTexture = new BitmapTextureAtlas(32,32, TextureOptions.BILINEAR_PREMULTIPLYALPHA);
- this.mPlayerTextureRegion = BitmapTextureAtlasTextureRegionFactory.createFromAsset(this.mPlayerTexture, this, "playertile.png", 0, 0);
- }
Parsed in 0.036 seconds, using GeSHi 1.0.8.4
Using java Syntax Highlighting
- private void initPlayer() {
- final TextureRegion PlayerTextureRegion = this.mPlayerTextureRegion.deepCopy();
- PlayerTextureRegion.setWidth(this.mPlayerTextureRegion.getWidth());
- this.mPlayer = new Sprite(32*7, 32*7, 32, 32, PlayerTextureRegion);
- this.mPlayerBody = PhysicsFactory.createBoxBody(this.mPhysicsWorld, this.mPlayer, BodyType.DynamicBody, FIXTURE_DEF);
- this.mPhysicsWorld.registerPhysicsConnector(new PhysicsConnector(this.mPlayer, this.mPlayerBody, true, false));
- this.mScene.attachChild(this.mPlayer);
- }
Parsed in 0.037 seconds, using GeSHi 1.0.8.4
But I tried everything and cannot get collision to work in:
Using java Syntax Highlighting
- public Scene onLoadScene() {
- this.mEngine.registerUpdateHandler(new IUpdateHandler() {
- @Override
- public void onUpdate(float pSecondsElapsed) {
- if(mPlayer.collidesWith(????????)) {
- }
- }
Parsed in 0.036 seconds, using GeSHi 1.0.8.4
Is there anybody that can help me?
Maybe it's just the tile creation process thats needs a rewrite, but how.
I want to clone several types of tiles to the board and have them collideable.
Thanks in advance.

