通过创建在Box2D的机器人andengine圈? [英] Creating circle in android andengine by box2d?

查看:170
本文介绍了通过创建在Box2D的机器人andengine圈?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以用于创建例如墙创建矩形:

I can create rectangle for creating wall for example:

    final Rectangle wall = new Rectangle(CAMERA_WIDTH-2, 0, 2, CAMERA_HEIGHT -2);
    PhysicsFactory.createBoxBody(this.physicsWorld, wall, BodyType.StaticBody, FIXTURE_DEF);
    scene.attachChild(wall);

不过,我想创建圈子?例如ball.it应该是Box2D的身体像上面。

But i wanna create circle? for example ball.it should be body of box2d like above.

推荐答案

它实际上是pretty简单:

It is actually pretty simple:

Body circleBody = PhysicsFactory.createCircleBody(pWorld, pSprite, BodyType.StaticBody, FixtureDef);

这篇关于通过创建在Box2D的机器人andengine圈?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆