Questions tagged [java]
Java is both a popular object-oriented programming language and runtime environment which allows Java programs to run unchanged on most hardware and software platforms.
412 questions with no upvoted or accepted answers
7
votes
0
answers
870
views
How to correctly implement 'layered lighting' with Box2D-Lights
How does one only allow Box2D-Lights to affect one and only one OrthographicCamera.
After researching, I found the following answer. This answer goes into detail ...
6
votes
0
answers
343
views
LibGDX Rectangle not Scaling to ImageButton Instance as Expected
below is the class I wrote for a GameButtoninstance:
...
6
votes
0
answers
164
views
balloon ligher than air with libgdx, impementation of FixtureDef.density, gravityScale, linearDamping?
I use libGdx/box2d's physic. My intention is to create a balloon filled with helium (a body, what hovers above a surface, if we apply a little force to it - it moves fast but not far, if we push ...
5
votes
0
answers
275
views
Implementing rubber rope
I'm using LibGDX to implement rubber rope in which player can fly and launch. I know I could use Box2D as physics engine and I'm going to one day, but I'd like to learn it myself for now.
I've ...
5
votes
1
answer
246
views
Fixing the size?
My app isn't compatible with all screen sizes. When testing on a small size, my textview overlaps with my button. So, as suggested on the Android Documentation, and many stack overflow pages, I ...
4
votes
0
answers
224
views
Why aren't my pieces rotating on my chess board in Java?
I am developing chess game in Java using the Netbeans IDE. Instead of rotating the whole board at each move, I thought of changing position of the pieces themselves, while the board remains same. All ...
4
votes
0
answers
829
views
Libgdx stops all sounds when there are lots of sounds
I'm making a 2D game for Android using Android Studio with Libgdx in Java.
I have a class, called SoundPlayer, which holds an ArrayMap. The key is the name of the sound file and the value is the sound ...
4
votes
0
answers
1k
views
LibGDX's HTML project doesn't show anything in Browser
The question is self explanatory, when I run my demo-html project as a Web Application and I open Chrome with the provided link by eclipse, my browser doesn't show the image it is supposed to show in ...
3
votes
0
answers
364
views
Strange normal mapping artifacts - OpenGL / GLSL
I have been following a few tutorials to learn some graphics programming with OpenGL, and recently implemented Normal Mapping.
It works well for the most part, especially for objects with normal-...
3
votes
0
answers
464
views
Weird libGDX BitmapFont Color Change (And Alpha) Bug
I want to change the color of my libGDX BitmapFont, but it can't change it. The font is generated with Hiero v5 (Lastest as I Know) but the color of the font doesn't change. Here is the example code, ...
3
votes
1
answer
365
views
How should I handle exceptions in libGDX?
I want to keep my game running as much as possible for the user, obviously. They would be dissapointed if the game suddenly quits without leaving any notice behind, and it would be difficult for them ...
3
votes
0
answers
503
views
Get mesh height at position
Me and my friends are creating a simple 3D game in LibGDX and are currently trying to implement simple collision detection with the terrain (ground). For this I thought the best way would be to simply ...
3
votes
0
answers
672
views
libGDX text doesn't appear in TextField
A game I'm working on has libgdx's TextField. They work fine in every instance I've used them, however on a play tester's phone he says no typed text appears in the box until enter or space is ...
2
votes
0
answers
99
views
Synch clocks between client and server in Java
We're developing a simple boggle game in Java for a college project (purely academic purposes, so we're trying to keep it simple).
Our application is composed by a client portion and a server portion. ...
2
votes
0
answers
598
views
Forge 1.14.4 Minecraft modding: Override vanilla loot tables
I cannot figure out how to override vanilla loot tables, I've been at this for hours, and I can't find anything online. Just very outdated tutorials.
I added custom crops and seeds to my mod, now I ...
2
votes
1
answer
298
views
Handling User Input Based on the Current Game State
currently i'm developing a 2D game in my spare time and i'm confused on how to handle the input from the player.
Currently my game uses the state design pattern, each game state is a different object ...
2
votes
0
answers
495
views
LibGDX - ImageButton and textures for touchDown and touchUp
I have problem with setting my ImageButton. I want to have two different textures in my button, first when ...
2
votes
0
answers
120
views
What heuristic should I use for A* pathfinding?
So, I've successfully implemented A* pathfinding (java) (http://www.cokeandcode.com/main/tutorials/path-finding/) in my game, but that pathfinding doesn't work as I wanted it to work. I don't know ...
2
votes
0
answers
220
views
Sprite animation in Android view
I'm looking for a way to have different sprite animations in individual Android views.
I try to use LibGDX and AndEngine but most I could find was how to get an Activity with the sprite animation.
...
2
votes
0
answers
1k
views
Using Box2D in LibGDX, is there a reason a fixture set to be a sensor would only -sometimes- detect a collision?
I am working on a 2D game in LibGDX. Currently, I am testing interactions between a player's weapon and enemies - in particular, a sword and an enemy monster.
The player has a hurtbox and the sword ...
2
votes
0
answers
1k
views
LibgGDX drawing two separate Textures in FrameBuffer
So I am trying to combine multiple TextureRegions in to one by using a FrameBuffer. This works extremely well when the ...
2
votes
0
answers
2k
views
Libgdx ParallaxScrolling and TiledMaps
I implemented ParallaxScrolling for my SideScroller project, everything is working but the tiled map (the most important part!). I've been trying out everything but it doesn't work (see the code below)...
2
votes
0
answers
1k
views
Rotation of viewplatform in Java3D
I have just started with Java3D programming. I thought I had built up some basic intuition about how the scene graph works, but something that should work, does not work.
I made a simple program for ...
1
vote
0
answers
48
views
How to configure multi-project for minecraft server mod for different ports using common code with minecraft mappings?
I want to make a gradle multi-project to port a server mod I made for Forge to Paper.
The problem I'm facing is that the common project doesn't recognise any ...
1
vote
2
answers
336
views
Making a game loop to run multiple threads
I'm having a really hard time understanding Threads and their contents.
What I'd like to have is a main game object (which I have) and a loop, where I can measure the time it takes for two threads to ...