小编Jet*_*res的帖子

和发动机物理实例

所以,我正在研究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
查看次数

标签 统计

andengine ×1

android ×1

game-development ×1

java ×1

physics ×1