Back to project page hiddenmarble.
The source code is released under:
Apache License
If you think the Android project hiddenmarble listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.mygdx.hiddenmarble.entities; // w w w .j a va2 s. c o m import com.badlogic.gdx.math.Vector2; import com.badlogic.gdx.physics.box2d.World; import com.mygdx.hiddenmarble.utils.BodyHelper; /** The default {@link Marble} implementation. */ public class DefaultMarble extends AbstractDynamicEntity implements Entity, DynamicEntity, Marble { private float width; /** * Creates a marble at the specified position. * * @param world the Box2D world * @param position the world position of the marble * @param radius the radius of the marble in Box2D meters */ public DefaultMarble(World world, Vector2 position, float radius) { super(BodyHelper.getMarbleBody(world, position, radius)); width = radius * 2; } @Override public float getWidth() { return width; } @Override public float getHeight() { return width; } }