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.

Filter by
Sorted by
Tagged with
2
votes
1answer
124 views

Potion effect never wears out

I am writing a mod for Minecraft (in Java, duh) and want to apply a random potion effect like this: ...
0
votes
0answers
19 views

Efficient method for Sprite Stacking in LibGDX

What would be a very efficient method for creating a suede 3D effect by stacking sprites much like the game like NIUM in LibGDX I find it easy to create a rudimentary system that stacks textures in a ...
0
votes
0answers
21 views

How to change the border color of a button in libGDX?

How to change the border color of a button. I know how to change the background, but I don’t know this, although I reviewed the entire documentation. And is it possible to find out whether the button ...
0
votes
1answer
46 views

Weird black lines when rendering in my Java Game Engine

I have an issue regarding weird horizontal and vertical lines that occur in my game engine. The lines is in the background color. It occurs when I draw a lot of tiles in this way: ...
0
votes
1answer
25 views

Android Game - Screen Flickers When an Entity Removed From The List

I am using Canvas in my android game. When I remove a no longer displayed entity in my entity list, all other entities are flickering for a brief time. When it's not removed, there is no such problem. ...
0
votes
0answers
66 views

Game server multiplayer architecture

I'm planning to build a big browser multiplayer game with gameplay very similar to agar.io but rpg. Game will be containing rooms as It's done in agar.io. 50-100 players max per room. Realtime. 10ms ...
1
vote
1answer
29 views

How do I prevent buffered image size fluctuation when rotating?

As you can see in the GIF, as the car rotates, as the Car rotates, the size appears to change to fit the determined height and width, what would be the best way to change these in conjunction with the ...
0
votes
1answer
48 views

Java application chokes - when using MySQL

If I use localhost - XAMPP, my application runs without problems. Once I try to use real MySQL databases: db4free.net, freedb.tech. Applications begins to choke and freezing, resulting it is nearly ...
0
votes
1answer
26 views

LibGDX How to adjust mouse aim angle calculation when screen is resized

I'm starting with a screen resolution of 1280 x 960 and that is the default resolution where mouse aiming is calculated thus: ...
0
votes
1answer
28 views

Efficiently color a procedural mesh?

I'm creating a procedural world with LWJGL and GLSL. I want to better visualize the biome map being produced and the height map it creates, but my attempts so far have been very inefficient. My first ...
0
votes
0answers
35 views

Java game loops with high tick times?

Take for example the first game loop from this question. A similar code is used in Minecraft (at least in older versions). I understand the concept and how this loop works in principle. But there is ...
0
votes
0answers
16 views

Netty: Disconnect client from server keeps reconnecting automatically

I have a game that connects to a server using the Netty API. Everything works correctly it seems when I click 'Login'; it will connect to server. However i've added an ingame button 'Back To Lobby'. ...
0
votes
1answer
48 views

How do I zoom in and out in a fully tiled based game

I am currently developing a tile based game in Java and trying to add the option of zooming. I do the zoom by reducing and enlarging the tiles, but the problem is that it creates spaces between the ...
0
votes
0answers
20 views

Rendering a quad using VAOs and VBOs in LWJGL 3 doesn't work

So, I just started learning LWJGL 3 and I used a mixture of a couple of tutorials and example code to make something that should render a rectangle to a magenta screen using VAOs and VBOs. There are ...
0
votes
1answer
16 views

Incorporating HttpSession into libGDX communication

I wrote my server-side code prior to learning libGDX and writing my client-side code. Gdx.net provides for the http get communication I designed for, except for session authentication. I say that ...
0
votes
1answer
41 views

LWJGL GLFW hangs on native glfwInit call

For the past months I've been working on creating my own game engine for personal use in LWJGL using pieces here and there, especially from developer ThinMatrix's rightfully credited code, to learn as ...
0
votes
1answer
78 views

In a top down game, once I have detected collision, how do I prevent it?

I'm making a top-down game in Java. I watched some videos, and this is the code I currently use when the player is colliding with an object: x += -velX y += -velY ...
0
votes
0answers
14 views

How to add sprite batch on tile in isometric map in Libgdx

I'm using Libgdx to create an isometric game , but now I have problem. I want to add sprite on tile (3,4) , but I can't do this, so I searched on stackoverflow , and I found this code :- ...
0
votes
0answers
23 views

How to convert coordinates into local object coordinates in libgdx?

How to convert click coordinates (Gdx.input.getX (), Gdx.input.getY ()) to local object coordinates? The screenToLocalCoordinates method does not work and does not convert coordinates. current-some ...
0
votes
1answer
50 views

Parts of OpenGL rendering area missing/transparent until resize

I am having a weird transparency issue when running my game in windowed mode. Parts of the window, left and top parts in normal window mode, right and bottom when in maximised window, become ...
0
votes
1answer
17 views

Changing ImageView position based on angle of rotation

I am trying to make an ImageView change its position based on the direction it is facing. ...
0
votes
0answers
25 views

How can I use Jung, GraphStream or JGraphT with LibGDX?

All libraries I found (JUNG, JGRAPHT, GraphStream) use Swing when I use libGDX. How you can use them with LibGDX
0
votes
0answers
18 views

JButton image and background color

I have read through and tried several approaches to changing the background color of a JButton with a buffered image, but I am consistently getting the same results. I am using a 2D array of ...
1
vote
1answer
77 views

How to implement the “technological tree” drawing?

I want to make a tech tree at least like in Civilization, but I don't know how to do it. I want to fill in some data structure and then display it on the screen in the form of a technology tree, but I ...
2
votes
2answers
206 views

LibGDX Efficient way to reduce a vector's value gradually until it reaches 0,0

I can manage to achieve this but the code seems to be much longer than it should be. Velocity is given an initial value, either positive or negative and then is ...
1
vote
0answers
46 views

Efficient way to store “item” objects in a simple game

I am developing a simple text-based game from scratch in Java. In this game, the user is able to collect items and store them in an inventory. My question is: how should I organize the internal ...
1
vote
1answer
23 views

(LibGDX) Set actor to fixed position on TiledMap

How can I set an actor to an absolute / fixed position on my TiledMap, such that it does not follow the camera when I pan around? Currently my code looks like: ...
0
votes
0answers
16 views

Trying to create a knockback effect between 2 squares (Code in Java)

I've been in trouble for weeks now and I don't understand why it doesn't work for me! I have tried so many things and I just can not understand. I try to get one player to get a knockback as soon as ...
1
vote
0answers
19 views

Recognize L-Shape in a 4x4 Matrix

I'm trying to make a board game, there the player has to press four buttons to make the L. It can be mirrored or rotated, it just has to be an L. But if the player press four buttons and make another ...
1
vote
1answer
62 views

Using server timestamp to synchronize actions across clients

tl;dr The question is rather simple: how unsynchronized can internal clocks be between different machines? Context We have a "hybrid" approach where the Clients are authoritative on certain ...
-1
votes
1answer
40 views

How to make camera move with the player in 3D Libgdx

Iam trying to create a 3D game in Libgdx, so I created a 3d World with physics, and added just a small terrain and capulse (the Player) . I want to make the game first person, so I created a player ...
-1
votes
2answers
69 views

How to load 3D modells when they are necessary

I'm working on a 3D game engine, currently I load ALL of my 3D modells into the memory when my game starts, but obviusly there will be hundreds of 3D modells, so somehow I should unload them when they ...
1
vote
0answers
23 views

How do I run LibGDX's Particle Editor in Netbeans?

I am trying to run the Particle Editor that comes with LibGDX in Netbeans. The gdx-tools-1.9.10.jar file shows up in my dependencies, and I can see all of the ...
1
vote
0answers
42 views

LibGDX Change mouse cursor to custom image…and keep it there

I'm able to create a custom cursor no problem using the following code running in my GameScreen's Show method: ...
0
votes
0answers
59 views

Unknown error when trying to register a Minecraft ArmorItem

The error in question is [Inferred type 'I' for type parameter 'I' is not within its bound; should extend 'net.minecraft.item.Item'] on the following snippet of code ...
1
vote
1answer
57 views

LWJGL 3 HelloWorld example crashing

I'm trying to start LWJGL 3 development and I am having an issue with getting things working. I have created a new Gradle project and successfully built the HelloWorld example from https://www.lwjgl....
1
vote
1answer
29 views

How to clamp a mouse angle within a field of view range of the facing direction

In my top down shooter game, the player can face in any of the 8 compass directions using the keyboard. Depending on the direction, the player will have a 90 degree field of view to turn based on the ...
1
vote
1answer
53 views

A star pathfinding path too narrow for enemy

The tiles for my top down 2D shooter are 32x32 and the player and enemies are too. But obstacles like walls and other things can of course be smaller than this - the smallest being 8x8. This causes a ...
1
vote
1answer
30 views

Libgdx opacity partial error

My model must support transfer textures but I can't do this using mesh + modelBuilder.part Opacity is tested correctly on only half of the model. ...
-4
votes
1answer
31 views

Increase speed when score gets high or when the fish eats pellets

I want fish to increase speed when score gets high, or when the fish eats some balls ...
2
votes
1answer
267 views

How can I save game “professionally”?

I am a novice programmer and just learned about the concept of saving and loading games. The way I am doing it is to write data into a text file and read it afterward. However, I realize how insecure ...
0
votes
1answer
26 views

Best way to make a Side Panel UI with Libgdx? (Java)

Take this image for example, the game is called Realm of the mad god, and it has this side panel filling the whole screen height with the player info. To reproduce it, Is there any way to make the ...
0
votes
2answers
58 views

Java LERP but with whole pixel values

I have a formula which returns a Lerp Vector3 value in integers but the problem is it never reaches the desired target value. It'...
0
votes
1answer
45 views

LibGDX Letter spacing is reduced if I use GlyphLayout to draw a bitmap font

I need to use glyphlayout so that I can centre the text, but I found if I do the text gets distorted due to the spacing being incorrect. ...
0
votes
1answer
105 views

Error while trying to Build APK, fails when profile option is enabled

When I build normally my android app it execute without no problems, but when I go to File -> Buil and Run and I eneble Development Build and Autoconnect to profiler I got this error ...
0
votes
1answer
30 views

Looking for tips on how to optimize/debug Java/Eclipse

I made a raycasting engine with wall textures. Before adding the texture the engine was silky smooth. With textures it has small lags (or stutters) when i move around and i would like to know why. My ...
0
votes
0answers
28 views

Flex Build error Error of java

...
0
votes
2answers
45 views

Class Not Found Exception on Class.forName()

Edit: Solved, for some reason my For each loop was getting out of bounds for the Starfish class, so I did a little null check and it worked out fine. I am having this exception on title. I have been ...
1
vote
1answer
29 views

Drawing object lines in the Tiled map editor

Suppose I have this picture: I have a map like this created in Tiled already. I would like to draw collision lines (the green ones in the picture) without having to make it a polygon. As far as I ...
0
votes
0answers
23 views

Dynamic spawn system

What are good approaches or patterns to structure a dynamic spawn system ? It should be able to "create" entities by their type-ID based on a set of rules which are able to change dynamic during ...

1
2 3 4 5
67