libgdx

Changes in code aren't reflected when I run Libgdx project on Android

徘徊边缘 提交于 2019-12-02 05:00:57
I've been following the Libgdx tutorial here and I'm running into a strange problem. Due to the constraints of my work environment, I can't download OpenGL drivers on my desktop, so I can't test my application on the desktop. I have to test it on my Android device. It's running some variation of an Android 2.3.4 build, which is API level 10. The problem is, whenever I make changes to my code and run the Android application, the changes aren't reflected. It just starts the build it installed the first time I ran my code. I uninstalled the app on my Android and re-ran it, running into the same

Collision detection of a ball with an arc

二次信任 提交于 2019-12-02 04:28:38
I am making a simple game in which i have a ball and an arc revolving around the center. When user touches the screen the ball moves in the direction of pointer and hits the arc. But i am not able to find any method to detect that collision An image has been attached for better understanding Game image Debug Snapshot.. I have a circle bound around my ball... What i am doing is Detecting the point of intersection of ball center and circle on which arc is >revolving. But i am not able to detect whether the arc was there when ball intersected the circle?? please help...:'( Code for making arc:

Rotating multiple sprites as one ( around same origin )

↘锁芯ラ 提交于 2019-12-02 04:04:43
问题 I have array of sprites forming T shape, and I want to ratate them around the same origin, in my case box2D body origin, like this: my shape is defined in matrix like this: int array[][]= {{0,1,1,1,0}, {0,0,1,0,0}, {0,0,1,0,0}, {0,0,0,0,0}, {0,0,0,0,0}}; this is how I create the body: public void setBody(int[][] blocks){ BodyDef def = new BodyDef(); def.type = BodyType.DynamicBody; def.position.set(new Vector2(0 * WORLD_TO_BOX, 0 * WORLD_TO_BOX)); Body body = world.createBody(def); body

Boolean not changing in thread

本秂侑毒 提交于 2019-12-02 03:43:49
I have a class MPClient and MultiplayerMatch. MultiplayerMatch, in his constructor, creates a MPClient runnable thread. To avoid data overflow, I have a boolean named "moved" in MultiplayerMatch that changes to true when the player is moving. In the updateMatch method, if there's any player movement, "moved" changes to true, which allow MPClient to enter an if statment (inside while). This way MPClient only sends data to the server when something changes on the game. Neverthless, when the flag is true, in MPClient that change is not registed! MPClient still "thinks" moved equals false, even

Android Studio LibGDX Gradle Sync Error

只谈情不闲聊 提交于 2019-12-02 03:41:25
After trying to run the gradle sync I get this error. I'm not sure if this is somehow related to libgdx or is it just a Gradle problem. Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'. It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html The minSdk version should not be declared in the android manifest file. You can move the version from the manifest to the defaultConfig in the build.gradle file. The targetSdk version should not be declared in the android manifest file. You

libGDX: Hanging rope knotted with some pivot

我只是一个虾纸丫 提交于 2019-12-02 03:07:46
I am trying to make a hanging rope having some object at it lower end in libGDX, Rope should be like hanging rope in Box2D I have done a lot of research, libGDX has its ropeJoint method but how to use it to make a rope? Please help, It will be a great favor. Waleed Mohamed I've started with the answer to a similar question libGDX: Hanging Rope and added some code to it to add some missing code and fix some problem in anchor, I think the following code is a suitable to the target proble: BodyDef ropeStartDef = new BodyDef(); int EACH_RING_DISTANCE = 10 ropeStartDef.type = BodyType.StaticBody;

not proper collision in box2d

给你一囗甜甜゛ 提交于 2019-12-02 02:29:10
问题 I am developing a game in which the user have to hit a high speed ball. To hit the ball I have joined a rectangular body with the actor using revolute joint and enabled its motor, to rotate it with a specified speed(motor speed). Now everything is perfect but sometime when ball`s velocity is high , it is bypassing the rectagular body. Using collision listner i found that collision is happening but ball is not getting reflected after collision. As this is happening only when ball is on a high

transparent circle black around

隐身守侯 提交于 2019-12-02 02:03:24
I'm trying to make transparent circle and everything around black with alpha. I'm using this code and it somehow doesn't work. Gdx.gl.glEnable(GL20.GL_BLEND); Gdx.gl.glBlendFunc(GL20.GL_DST_COLOR, GL20.GL_ZERO); Gdx.gl.glBlendEquation(GL20.GL_FUNC_ADD); shapeRenderer.begin(ShapeRenderer.ShapeType.Filled); shapeRenderer.setColor(new Color(1, 1, 1, 1f)); shapeRenderer.circle(150,500,300); shapeRenderer.end(); Gdx.gl.glDisable(GL20.GL_BLEND); I want this: You can use FrameBuffer for your requirement. public class GdxTest extends ApplicationAdapter implements InputProcessor { FrameBuffer

Libgdx, Transitive dependencies Android,Java library project, Jar

老子叫甜甜 提交于 2019-12-02 01:53:12
I have just created template Libgdx project (Core,Android,Windows). Core is regular Java project library. There is a dependency in Core to XStream.jar library. Core contains file input-output via Xml. Android project has dependency to java core project. Now XStraem is working for Windows but not for Android. For Android i got this: 01-22 13:03:24.141: E/AndroidRuntime(25074): FATAL EXCEPTION: GLThread 5187 01-22 13:03:24.141: E/AndroidRuntime(25074): Process: com.barsoft.drag, PID: 25074 01-22 13:03:24.141: E/AndroidRuntime(25074): java.lang.NoClassDefFoundError: com.thoughtworks.xstream

Rotating multiple sprites as one ( around same origin )

泄露秘密 提交于 2019-12-02 01:21:37
I have array of sprites forming T shape, and I want to ratate them around the same origin, in my case box2D body origin, like this: my shape is defined in matrix like this: int array[][]= {{0,1,1,1,0}, {0,0,1,0,0}, {0,0,1,0,0}, {0,0,0,0,0}, {0,0,0,0,0}}; this is how I create the body: public void setBody(int[][] blocks){ BodyDef def = new BodyDef(); def.type = BodyType.DynamicBody; def.position.set(new Vector2(0 * WORLD_TO_BOX, 0 * WORLD_TO_BOX)); Body body = world.createBody(def); body.setTransform(130*WORLD_TO_BOX, 200*WORLD_TO_BOX, -90*MathUtils.degreesToRadians); for (int x = 0; x < 5; x++