libgdx

How to remove gaps between tiled textures?

ε祈祈猫儿з 提交于 2019-11-29 01:53:14
I'm using LibGDX to make a platformer. I'm using square tiles for the platforms but when they are drawn some of them have gaps between them. When I zoom in/out or move the camera around the gaps move position. More details: Tiles are 32x32 and I have tried both 32x32 and 64x64. Tiles are lined up 32 pixels apart (e.g. first tile would be x=0 y=0, second x=32 y=0, and so on in both x and y directions). The gaps are not texture artifacts as I have checked this. I use the TexturePacker with padding. My best guess is that it is a problem when converting the textures to screen coords but have no

set a delay in libgdx game

纵饮孤独 提交于 2019-11-29 01:13:19
问题 i have a game(like super jumper, this game is a jumping game) that our character has life. after collision with enemies, his life reduce. and i want to after 1 sec , calculate the collisions. i mean in this 1 sec, if my character contact with enemies , nothing happen and he continue his way. for this , i define a boolean variable in my GameScreen class, name "collision" and another in Wolrd class, name "collBirds". after one contact with enemy collision and collBirds change to true. but i

Switching between screens Libgdx

浪子不回头ぞ 提交于 2019-11-29 01:10:34
问题 Hey everyone I am still working on this libgdx project and I am trying to figure out the best way to change the screens to my game screen Now, when a button is clicked I need it to transition to the game screen. I have seen a few implementations extending the game class but I am not sure what the best approach from here is. If you see some code that could be improved please let me know. Here is the main application class: public class ConnectFourApplication implements ApplicationListener {

AdMob won't show the banner until refresh or sign in to google plus

大兔子大兔子 提交于 2019-11-29 00:39:39
问题 I've got a problem. My AdMob has been set up for some time now without any problem, but I noticed something wrong. Ad gets successfully loaded (i see message from ddms), but it won't show. It will get shown after periodical 60 seconds refresh or when I open up login to google plus. The problem happens only with Google Play Services AdMob and not with AdMobSDK jar. I'd switch to AdMob jar, however I'm using Google Play Game Services for leaderboards and achievements. I suspect the problem is

Libgdx how to use shader in 3D

点点圈 提交于 2019-11-29 00:36:42
I reached a point in my wip game, where I want to make it more eye-appealing. Currently I add some Ambientlight and a Directionla-light to an Environment and render my scene with it. But now I want to add a custom Shader to it. So I have been looking for some tutorials and for some reason in almost every tutorial they have used another "version" of using Shader in their game: Giving the ModelBatch a String or FileHandle vertex/fragment -shader Creating a ShaderProgram with vertex and fragment Shader . Creating a new DefaultShader with this vertex and fragment Shader . Creating a class, which

Libgdx setup UI gives 2 unexpected errors in new GWT project

若如初见. 提交于 2019-11-28 22:43:17
I have run the setup ui, however, I get two different errors in the -html project than what is described in the tutorial: libgdx tutorial The tutorial error stated is as follows (which is an error I do not see): To fix the error of the HTML5/GWT project, go to the "Problems" view, right click the error message "The GWT SDK JAR gwt-servlet.jar is missing in the WEB-INF/lib directory" and select "Quick Fix". Click "Finish". The errors I have are: The project was not built since its build path is incomplete. Cannot find the class file for com.google.gwt.core.client.EntryPoint. Fix the build path

How to make a smooth camera follow algorithm?

孤人 提交于 2019-11-28 22:37:23
问题 I am making a game with LibGDX (Java). I need the camera to follow a fast moving character. The easiest way to do it is to just write this: this.getCamera().position.set(obj.x, obj.y, 0); But, is there any algorithm to make this more smooth? Like when camera is not that strict, and is always a bit late: character goes quick right, camera follows with slight delay, or if you suddenly appeared somewhere far, camera doesn't teleport instantly but travels at a top speed to you when it comes

Understanding libgdx

心已入冬 提交于 2019-11-28 22:03:54
I understand that it is a framework; even more an open-source cross-platform game development library. I went to the libgdx homepage and followed the instruction on the video tutorial. After properly setting up my project I was able to run the default my-gdx-game project on the multiple supported platforms. Great, fine and dandy...now what? I have been scouring the forums, wikis, javadocs, and many many more sites looking for decent straightforward how-to's. Unfortunately I couldn't find any, most of the help out there assumes you have some basic knowledge of this library. I feel like the

LibGDX - Get Swipe Up or swipe right etc.?

偶尔善良 提交于 2019-11-28 21:35:26
touch area http://imageshack.us/a/img836/2909/swipe1.png In the green area the user can swipe up, right, down, left. How can I now get e.g. swipe Up? or swipe Down? or swipe right or swipe left? e.g. how to get a String -> input = getSwiped(); -> input is then Up, or right, or down, or left And the user can touch two buttons. 1 or 2. 1 is for duck and 2 is for jump. I want to check this inputs at the same time. The user can touch and also swipe Up at the same moment. I know there is a GestureDetector. I looked at the code, but no clue how can I use the swipe part. I know a little bit how to

(when adding jar) - Module “android” must not contain source root

做~自己de王妃 提交于 2019-11-28 21:03:09
问题 I'm trying to add gdx-tools.jar to a libGDX project in IntelliJ. The result: Module "android" must not contain source root ".../android/src". The root already belongs to module "android". This is what I've tried: project structure > libraries > new project library > java > select "gdx-tools.jar" >select module "desktop" project structure > modules > select "desktop" > new > jars or directories > select "gdx-tools.jar" > Ideas? 回答1: Just by going to the Artifacts Settings, Modules, Sources tab