Back to project page Fruity-Bang.
The source code is released under:
MIT License
If you think the Android project Fruity-Bang 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 GameModel; /*from www .jav a 2s.com*/ import Game.GameConstant; import com.jme3.bullet.collision.shapes.BoxCollisionShape; import com.jme3.bullet.control.RigidBodyControl; import com.jme3.math.Vector3f; import com.jme3.scene.Spatial; /** * @author Thong */ public class Rock extends CuteModel implements GameConstant { private RigidBodyControl rockControl; public Rock(Spatial s) { super(s); setName("Rock"); BoxCollisionShape capsule = new BoxCollisionShape(new Vector3f(PLACE_HOLDER, PLACE_HOLDER ,PLACE_HOLDER)); rockControl = new RigidBodyControl(capsule, 0f); addControl(rockControl); } /** * * @param x the x position of the rock on the map (2D) * @param y the y position of the rock on the map (2D) */ public void render(int x, int y) { float ratio = 1f; render(x, y, rockControl, ratio); } }