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.
3,440 questions
1
vote
1
answer
104
views
Objects move with different speed on different devices
I was making a 2d top-down game, but when I tested it on two devices (Samsung M31 and Samsung S25) there was a problem with player speed - it was faster on S25 and slower on M31. I tried using some ...
4
votes
1
answer
703
views
SquidSquad - how to use WildernessGenerator and Biomes
I'm starting to create a roguelike, and stumbled upon SquidSquad, which has an amazing collection of algorithms and other stuff related to roguelikes.
However, for some parts, documentation is really ...
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 ...
0
votes
0
answers
87
views
How do camera matrix multiplications work?
I was trying to make a 3d renderer in Java and was very confused about how to multiply the camera matrices correctly. So for the camera transformation matrix (T) I need a translation matrix (C) and ...
0
votes
1
answer
85
views
How to destroy/remove Texture after collision in java box2d
I'm coding a simple Arkanoid/Breakout game and have problems with removing the bricks. I'm able to destroy the body but the texture is still there. I'm a beginner so is there a simple way to remove it ...
1
vote
0
answers
66
views
How to make a Minecraft Villager walk to a Location?
For Minecraft, utilizing the Bukkit/Spigot API, I have a LivingEntity Villager that I would like to path, or "walk" to ...
1
vote
1
answer
73
views
LibGDX TiledMap - get embedded objects from TextureMapObject
Is there a way of getting embedded objects defined within Tiled's collision editor from TextureMapObjects?
It'd be great if I could place texture objects around on an object layer and also include ...
0
votes
0
answers
361
views
How do I fix java.lang.ClassNotFoundException: org.lwjgl.glfw.GLFW
I have not used Java in a while and thought I might try LWJGL with OpenGL and GLFW.
I am using Apache Maven as a Build System.
It lets me compile the program, but when I run it, it says:
...
0
votes
1
answer
168
views
Comparison of 2 different quaternion axes
I am trying to compare the Z-axis and the X-axis of two different quaternions in a way that would give me the Euler angles about the X and Y axes to line up the two different axes. In my program, the ...
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 ...
0
votes
3
answers
148
views
Reduce processing time of image to shape
I'm making a simple game engine using Java and have found a major issue.
To create accurate collision detection I decided to convert a transparent image into a ...
0
votes
1
answer
96
views
How to save score without resetting to 0 between Game Scene and Pause Scene?
I'm currently working on a LibGDX Java Game Project inspired by the Space Invaders game where I have created 2 Scene Classes: LevelScene and ...
1
vote
0
answers
66
views
JBullet - Shoving around objects
Sometimes in video games the players can walk up to certain objects for example boxes and barrels and shove them around.
How can I recreate this system? What function do I have to use to apply force ...
2
votes
1
answer
294
views
GLSL wrong data read from attribute
I'm developping an OpenGLes 3.0 app with Java and I started writing the shader code. For some reason, it seems to mix up the attributes data locations and I don't understand why. Here's the code :
...
1
vote
0
answers
92
views
LWJGL3. A strange graphic artifact of OpenGL 3.x
I work in java with lwjgl3. I came across a strange artifact, the source of which I have not been able to determine for a very long time. I'm drawing a large surface. When I approach this surface and ...
0
votes
0
answers
64
views
How do I go about making an enemy change depending on where the player hit it?
Currently coding in java, using cocos engine, making a low-poly game with a world which changes based on what the player does, hopefully including the aspect of an enemy changing when the player hits ...
0
votes
0
answers
40
views
Image fragments when moving up and or left
Not entirely sure how to resolve the issue as I am quite new to programming, however this seems to be my last option in terms of finding an adequate solution.
EDIT: https://streamable.com/0i92xq - ...
0
votes
1
answer
90
views
Modifying LibGDX vector2's seems to do nothing
I have a piece of code similar to this:
Vector2 test = new Vector2().setLength(20).setAngleDeg(45);
But when I'm trying to print its contents (such as ...
0
votes
0
answers
98
views
How would I make a self updating launcher for my game in Java?
I have a game I am working on, and I want to make a launcher for it. I am having trouble finding information on how to do it in Java (my video game is programmed in Java, so I do not want to use C#, ...
1
vote
2
answers
197
views
Is it appropriate to design heroes as items in game development?
If you were to design a multi character game like "Genshin Impact", would you design the character(hero) as a item?
What is an item: in our game design, an item is an object within the game ...
0
votes
1
answer
278
views
Unknown enum type when modding Minecraft recipes with CraftTweaker
I want to make some new Recipes with CraftTweaker, which uses machines from the Create mod (I'm using Life In The Village 3), but I have the following error in my scripts:
...
0
votes
0
answers
209
views
Good design for player input handling in 2d game
I am working on a java 2d game. Keeping things short, I'd like to improve my current input handling. Basically the player can move up/down/left/right with WASD, perform an attack with mouse left click ...
0
votes
1
answer
785
views
How do I implement Minecraft Forge Config GUI (1.8.x)
So I have recently been working on a minecraft 1.8.9 forge mod, just to play around and see what there is (eventually I am planning on making a utilities mod with versions for 1.8-1.19, which is why I'...
1
vote
0
answers
138
views
Animate buttons sliding in
I am developing my first libGDX game.
I want to animate the buttons on the stage, so they transition into view instead of just popping into appearance. For example, each button should slide in from ...
0
votes
1
answer
730
views
How to enable V-Sync in Java?
I have used the BufferStrategy, but my code runs still way too fast. xrandr reports that TearFree is "on" and the ...