标签: andengine

BitmapTextureAtlasTextureRegionFactory.createFromAsset崩溃

几个月前我已经看了一下dedengine,我设法做了一些事情.现在我下载了最新版本,我最简单的事情就是崩溃了.在这里我的代码

package francesco.mygame;

import org.anddev.andengine.engine.Engine;
import org.anddev.andengine.engine.camera.Camera;
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.Sprite;
import org.anddev.andengine.entity.util.FPSLogger;
import org.anddev.andengine.opengl.texture.TextureOptions;
import org.anddev.andengine.opengl.texture.atlas.bitmap.BitmapTextureAtlas;
import org.anddev.andengine.opengl.texture.atlas.bitmap.BitmapTextureAtlasTextureRegionFactory;
import org.anddev.andengine.opengl.texture.region.TextureRegion;
import org.anddev.andengine.ui.activity.BaseGameActivity;



public class mainMenu extends BaseGameActivity 
{

// ===========================================================

// Constants

// ===========================================================
static final int CAMERA_WIDTH = 480;

static final int CAMERA_HEIGHT = 320;



//private static final String TAG = "Main Menu";


// ===========================================================

// Fields

// ===========================================================

protected Camera mCamera;  
protected BitmapTextureAtlas mTexture;
protected TextureRegion mPlayTexture;
protected Sprite …
Run Code Online (Sandbox Code Playgroud)

java crash android andengine

0
推荐指数
1
解决办法
4506
查看次数

音量控制在我的应用中不起作用

我正在开发一款游戏,当游戏正在播放时,音量控制无效.有人能给我解决方案吗?

它在AndEngine中

android andengine

0
推荐指数
1
解决办法
2381
查看次数

和发动机物理实例

所以,我正在研究AndEngine PhysicsExample代码.我想知道这种方法的含义是什么(http://pastebin.com/Day2hciB):

private void addFace(final float pX, final float pY) {
        this.mFaceCount++;
        Debug.d("Faces: " + this.mFaceCount);

        final AnimatedSprite face;
        final Body body;

        if(this.mFaceCount % 4 == 0) {
            face = new AnimatedSprite(pX, pY, this.mBoxFaceTextureRegion, this.getVertexBufferObjectManager());
            body = PhysicsFactory.createBoxBody(this.mPhysicsWorld, face, BodyType.DynamicBody, FIXTURE_DEF);
        } else if (this.mFaceCount % 4 == 1) {
            face = new AnimatedSprite(pX, pY, this.mCircleFaceTextureRegion, this.getVertexBufferObjectManager());
            body = PhysicsFactory.createCircleBody(this.mPhysicsWorld, face, BodyType.DynamicBody, FIXTURE_DEF);
        } else if (this.mFaceCount % 4 == 2) {
            face = new AnimatedSprite(pX, pY, this.mTriangleFaceTextureRegion, …
Run Code Online (Sandbox Code Playgroud)

java android physics game-development andengine

0
推荐指数
1
解决办法
779
查看次数

如何在Android AndEngine中执行动画?

当我必须在我的场景上移动一些精灵(例如,在100px向下)时,我正在使用此代码:

Timer timer = new Timer();
for (int i=0; i<10; i++) {
    delay+=frameDelay;
    timer.schedule(new TimerTask() {
            @Override
            public void run() {
                sprite.setPosition(sprite.getX(), sprite.getY()+10);
            }
        },delay);
}
Run Code Online (Sandbox Code Playgroud)

它有效,但我想知道是否有更多正确和/或更快的可能性来做到这一点.

animation android andengine

0
推荐指数
1
解决办法
3697
查看次数

在AndEngine中,在哪里调用实体更新方法?

我正在使用AndEngine,我采用了一个组件实体模型来开发我的游戏.我的问题是在AndEngine设置中,我应该在哪里以及如何调用我的实体(及其组件)的更新方法?

我两天前才开始使用AndEngine,所以请原谅我的任何小说.

java android updates andengine

0
推荐指数
1
解决办法
1308
查看次数

删除精灵时,Andengine索引超出范围

从场景中删除我的精灵时,我得到一个超出范围的索引.请注意,我想从Explosion类中删除精灵,以使我的游戏类尽可能"干净".

这是我创建精灵的地方.

mScene.registerUpdateHandler(new IUpdateHandler() {
    public void onUpdate(float pSecondsElapsed) {
        if(something) {
            final Explosion expl = new Explosion(m.getX(), m.getY(), 
                getVertexBufferObjectManager(), false, 65);

            mScene.attachChild(expl);
        }
    }
});
Run Code Online (Sandbox Code Playgroud)

在动画结束时删除精灵的爆炸类

public class Explosion extends AnimatedSprite {

private final Explosion self;

public Explosion(float pX, float pY, VertexBufferObjectManager pVertexBufferObjectManager, 
        boolean loopAnimation, long frameDurationEach) {
    super(pX, pY, regExplosion, pVertexBufferObjectManager);

    this.self = this;

    this.animate(frameDurationEach, loopAnimation, new IAnimationListener() {

        @Override
        public void onAnimationStarted(AnimatedSprite pAnimatedSprite,
             int pInitialLoopCount) {
        }

        @Override
        public void onAnimationLoopFinished(AnimatedSprite pAnimatedSprite,
            int pRemainingLoopCount, int pInitialLoopCount) { …
Run Code Online (Sandbox Code Playgroud)

android sprite andengine

0
推荐指数
1
解决办法
1063
查看次数

setTouchAreaBindingOnActionDownEnabled - AndEngine的目的是什么?

我开始使用AndEngine,我看到一些教程使用setTouchAreaBindingOnActionDownEnabled但不解释其目的.

为什么我需要和这个方法一起使用onAreaTouched?不应该是onAreaTouched足够的,并检测它里面是否是向下或向上?

谢谢

android andengine

0
推荐指数
1
解决办法
553
查看次数

-2
推荐指数
1
解决办法
5915
查看次数