libgdx

Libgdx: Lags in soundtrack looping

末鹿安然 提交于 2019-12-20 05:16:06
问题 I'm having trouble with music looping in libgdx. I know a simmilair topic was here before, but it didn't help me at all. The thing is that when you go to main menu in my game (link) the sound of rain is looped. Unfortunately, there is a short moment of silence between each play and I don't know why - you can download the game and see what I mean. I'm already using .ogg format, so the solution from the other topic I found here didn't really help. If I play this sound in a loop in Audacity, it

Libgdx: Lags in soundtrack looping

六月ゝ 毕业季﹏ 提交于 2019-12-20 05:16:00
问题 I'm having trouble with music looping in libgdx. I know a simmilair topic was here before, but it didn't help me at all. The thing is that when you go to main menu in my game (link) the sound of rain is looped. Unfortunately, there is a short moment of silence between each play and I don't know why - you can download the game and see what I mean. I'm already using .ogg format, so the solution from the other topic I found here didn't really help. If I play this sound in a loop in Audacity, it

How to make player get destroyed through camera?

北城以北 提交于 2019-12-20 04:55:35
问题 I've been having some trouble making the player get destroyed through the camera. In my application, I made the camera follow the player(the ball). But the camera can only follow the ball upward. So what I want to accomplish is, when the player(the ball) reaches the bottom of the interface(the screen) it gets destroyed. After it gets destroyed it would be good, if a new activity(new screen) pops up, that says "Game over". Thanks a lot for the great support. the interface of the application

libgdx Cutting an image

匆匆过客 提交于 2019-12-20 04:30:47
问题 I have been trying to "cut" an image for some time now, I ll explain why and what I tried. So I wanted to create an hp "bar" except it's not a bar but a heart and so I though it would be easy all I had to do is have two pictures draw them on top of each other and then just cut one to make it appear as in hp was being lost, but I was not able to find a way to cut the image. Setting the height just resizes the image as you might have guessed I tried using textureRegion to kind of hack it but it

libGDX animation for android

ⅰ亾dé卋堺 提交于 2019-12-20 04:28:22
问题 If I start it for Desktop it runs pretty nice, but after the export for my Android it crashes right after I start the application. So my question...: What's wrong that it works for the Desktop but not for my Android? public class Player implements Serializable{ /** * */ private static final long serialVersionUID = -7913517465400462738L; Vector2 position; private static final int col = 4; private static final int row = 4; private Animation animation; private Texture playerTexture; private

how to implement Fling on group

限于喜欢 提交于 2019-12-20 04:19:44
问题 I want to fling some images after some animations on them are over, and the animations run inside a window: The red one which is above the other one, what I tried is: if (xDn - xUp > 0) { Timeline.createSequence() .beginParallel() .push(Tween.to(GBMImage, SpriteAccessor.X, 0.2f) .target(170f)) end().start(tweenManager); } where xDn and XUp are ontouchDown and ontouchUp x values. To move the image left and right. Now the problem is on left, fling image goes over the back window, which I want

Collision detection of a ball with an arc

我们两清 提交于 2019-12-20 03:52:19
问题 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

Using Parallax screen

邮差的信 提交于 2019-12-20 03:15:22
问题 I want to use parallax screen in my game code using libgdx in which screen is moving in y direction. My game code is given as... public class ParallaxLayer{ public TextureRegion region ; public Vector2 parallaxRatio; public Vector2 startPosition; public Vector2 padding ; public ParallaxLayer(TextureRegion region,Vector2 parallaxRatio,Vector2 padding){ this(region, parallaxRatio, new Vector2(0,0),padding); } public ParallaxLayer(TextureRegion region,Vector2 parallaxRatio,Vector2 startPosition

Adding libgdx to an Android Native Application

霸气de小男生 提交于 2019-12-20 02:28:30
问题 I have a simple kids app which teaches things such as colors, numbers, etc... which I am currently developing. It uses what I would consider "standard android java programming (Single Xml/java class)." I also have a simple game with a Dinosaur that jumps over letters using libgdx. My question is, I would like to have the game as part of the "overall" app. I would like to know if it is even possible to add a libgdx game to an android native application. I tried adding the appropriate files to

UnsatisfiedLinkError Libgdx Desktop

落爺英雄遲暮 提交于 2019-12-19 19:04:23
问题 I am running into issues with LibGDX on Desktop. I keep getting the following error when trying to launch the application: Exception in thread "main" java.lang.UnsatisfiedLinkError: com.badlogic.gdx.utils.BufferUtils.newDisposableByteBuffer(I)Ljava/nio/ByteBuffer; at com.badlogic.gdx.utils.BufferUtils.newDisposableByteBuffer(Native Method) at com.badlogic.gdx.utils.BufferUtils.newUnsafeByteBuffer(BufferUtils.java:288) at com.badlogic.gdx.graphics.glutils.VertexArray.<init>(VertexArray.java:62