Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

0
votes
1answer
5 views

Meshes exported from blender as .obj does not map correctly

I am having some problems with developing my game in OpenGL with java (Using LWJGL3). I have been following a guide for the more complex steps of the process, like loading meshes. When using the ...
0
votes
1answer
35 views

Which part of the frustum sits at the eye position?

In Java I create a frustum projection matrix via Matrix.frustumM(projMatrix, 0, left, right, bottom top, near, far); and a view matrix via ...
0
votes
0answers
58 views

What is a good way to implement a message system?

I'm trying to figure out how to make a message system like the one below. Here is what I've done so far but not sure what I should do next. Main panel class: ...
0
votes
2answers
78 views

Should I (and how to) avoid using global classes [on hold]

I have been having fun learning java for years, did a little bit of OOP tutorials and this is the first time I attempt to make a real project. The project is very similar to some top down view ...
0
votes
0answers
11 views

How to have zoom and translate in .tmx map in android

I load a .tmx file in libgdx project but I can not zoom in and zoom out and control map like a google maps in android device. how to implement this features in .tmx file with Screen touch. this is my ...
1
vote
1answer
26 views

Draw line between tiles of tiled map in libgdx

I want to draw line between two tile of my .tmx map in libgdx . I want to get a tile position but not in pixels , in maps grid numbers like : (0 , 6 ). or is there any way to change a tile color in ...
0
votes
1answer
20 views

LibGDX Box2dlights - Body Shadow Problem

While playing around with the box2dlights with libGDX, I have managed to get it all up and running, but have a problem with the shadow rendering. This is what I currently have atm: With the lighting ...
0
votes
0answers
12 views

Game State Manager(FSM) with in.nextLine()

I recently started creating a text based game and had posted a question regarding it here once before. Upon asking that question it was brought to my attention that my game loop was too long and that ...
0
votes
1answer
16 views

Minecraft modding 1.12 draw image

I want to draw an image that I created but the image is too big. Now I want the Gui to scale the image to a reasonable size, but when I change the width and height it doesn't make the image scale down/...
-1
votes
0answers
34 views

LibGDX AStar Pathfinding on a Tiled Map

I want to have pathfinding in my .tmx file that I created with the Tiled tool for libgdx, but I am just a beginner wirh libgdx. I use Tiled to build my game map. In this grid map, I want to add a ...
0
votes
0answers
11 views

Simple Text Based Game Buffer/Render Strategy

Is there any reason to use a Buffer/render strategy OR an update/tick method (for fps and such) within a Text Based game(as of now just being an empty black space with text similar to CMD)? If so ...
0
votes
0answers
12 views

Handling events at LIBGDX. The event is registered in two place at the same time

Im creating a turn base-fight game and I have the problem that I want to create a button where you can click it and then it need to click on the target enemy. So far this is the part of the code I ...
0
votes
0answers
23 views

How to use Bullet ghost objects in libGDX?

So I went and did some research on how to get Bullet's ghost objects work in libGDX. There was nothing about the Java port of it, so I tried to translate some of the C++ code I found into Java. ...
0
votes
1answer
65 views

Develop on Oculus Go using Java and OpenGL

I have recently done some game development using Java and OpenGL (with the JOGL library), and I was thinking about trying to learn how to develop on an Oculus GO. However, all guides seem to assume ...
0
votes
0answers
22 views

How to get Context at Canvas, Runnable or onTouchEvent?

I'm beginner programming (30 day newbie only), but cannot find the answer so try to ask here. Cause the program too many image, if one time load image will OOM, try to split separate part to load ...
-1
votes
1answer
45 views

Is it possible to do 2d character movement with vectors instead of using tiles

we have a character moving through a house and so far we used tiles to simulate character movement. Is it possible to use a vector image of the character and move the points via vectors to simulate ...
0
votes
1answer
56 views

Should I use Panels or Frames?

Hi I am creating my first game in NetBeans using Java, the game is going to be an RPG that will look a bit look Undertale on the surface in that there will be a menu, then a load game section and then ...
0
votes
0answers
24 views

Repeat a region of an atlas

I'm using libGDX and I've switched from using a Texture instance for each wall in my game to an atlas. The wall texture you see was repeated alright: As you can see, it skips textures when I switched ...
0
votes
0answers
13 views

How to keep sprites in sync with non-box box2d polygon shapes

By non-box box2d polygon shapes, I mean polygon shapes that are made by specified vertices, instead of using the setAsBox method of box2d polygonshape class. I know this much: CycleShape and box ...
0
votes
0answers
18 views

multiple mouse events for splitted screen on Libgdx

well i am working in a fps game , and i also splitted the screen in two parts for two players , i am using the mouseMoved event for the camera,, but in this situation literally i need two cameras each ...
0
votes
1answer
117 views

Use a different language for engine and game

Just a quick question that I haven't been able to find an answer to, I am creating an engine for a game, I have begin making the engine in C++ but I want to make the game in java. My question is, is ...
1
vote
1answer
117 views

How to allow to slide rectangle to not colliding with corners between two rectagles?

I am detecting each side of collision between two rectangles, and wen I collide them, lets say, with the left side, it also detects collision on the top side when I move to the top, and the downside ...
0
votes
0answers
14 views

libgdx button doesn't work everytime

I made a button, which stops my game. The is a menu, where you can continue the game. But if the cam moves with the player, the button doesn't work anymore. You can see it, but if you click on it ...
-2
votes
1answer
44 views

Making a Java Swing game a browser based game [closed]

I have made a game in Java using Swing for the GUI. It is a network game relying on the client-server model. Basically the game is a turned-based chess-like game. It has a connection menu, game ...
0
votes
1answer
53 views

LibGDX - Animate Player using Finite State Machine in Ashley ECS

Hi everyone this is my first question on this forum hope you can clarify my doubt. I'm gonna start by saying that im not very good at english so my apologies. So I have a big school project and I'm ...
0
votes
0answers
5 views

IllegalStateException while rendering font via slick-util TrueTypeFont

I tried to load a font via Font awtFont = new Font("Times New Roman", Font.BOLD, 24); TrueTypeFont font = new TrueTypeFont(awtFont, true); and then call ...
0
votes
1answer
63 views

How to create an even gamescore?

Currently I'm doing an android game. My problem is the score. The game speeds up in every round and currently I'm counting the score like this: ...
-1
votes
1answer
30 views

trying to work out coords based collision [closed]

In this game I'm working on, both player and enemies are represented by 32x32 sprites(not using bounding boxes). I'm trying to make a system where if the x and y coordinates of the player and ...
0
votes
1answer
39 views

Correctly drag object with mouse

I already have a MouseMotionListener with the mouseDragged method implemented. I can drag an object with the mouse, but it doesn'...
1
vote
1answer
116 views

My Java Game's movement looks awfull. Maybe Problem with Thread.sleep

I have a big problem with my Java games. In every game I make the movement of the player and objects just looks awfull. The framerate is 60 fps without any problems. But the movement looks extremly ...
0
votes
2answers
87 views
0
votes
1answer
65 views

Billboard quad in same draw call?

I am currently drawing a isometric world in 3D, meaning the floors and walls are all quads aligned to the original axis in the world and using a rotated orthogonal camera to "distort" the images into ...
0
votes
0answers
53 views

How can I use the NDK to make games?

I want to use NDK to use my existing C++ code for a game. I know there are two ways to use NDK: I can use Java to create GLSurface and opengl context; I can use NativeActivity class to entirely write ...
0
votes
1answer
28 views

Cannot find folder when building game to .jar LibGDX

Whenever I run my game from my IntelIJ IDEA the game runs fine. It finds every folder and every asset in there. But whenever I build my game with :desktop:dist and ...
0
votes
0answers
33 views

how to combine, intersect or subtract shapes? [duplicate]

is there a way to intersect, combine or subtract multiple shapes together similar to java.awt.geom.Area in LIBGDX or any libraries similar to this that will work on any device?
0
votes
0answers
21 views

Developing RCON for Squad

I have found in the internet Java RCON Library - https://github.com/Kronos666/rkon-core, but then I entered IP, port and password and asked server to send available commands - server didn't respond. I ...
0
votes
0answers
31 views

libgdx - can't drag/click on Dialog

I'm having problem with Dialog. I have Dialog (let's say MainDialog) with button. After the button is clicked, another Dialog pops up. Everything is fine, but I can't drag nor click the buttons from ...
0
votes
0answers
50 views

How can I fix this MineCraft Forge OpenGl error?

I am making a MineCraft Forge 1.12 gun mod. The gun works but I only need to add some animations for reload and aim. So I have tried something but I gives me an error every time. ...
0
votes
1answer
36 views

How can I speed up the shapes drawing on high-density devices?

I have a game that should draw many shapes on the canvas and in every frame these shapes position will change, the game is running smooth but after adding more shapes some jerk arise and it drops some ...
2
votes
2answers
36 views

How can I efficiently change the color of a BufferedImage?

I am trying to change the color of a white BufferedImage image. I do know that you can use .setRGB(x,y,rgb) and simply run some ...
0
votes
1answer
21 views

libgdx - getButtonTable() missing Window method

I'm following some tutorial to create my own Inventory for my game. I have met with an insidious problem: ...
0
votes
1answer
55 views

libgdx - creating static HUD/widgets on screen

I'm having problems with creating static HUD/buttons on the game screen. Currently my game has a character moving on the tiled map, with OrthographicCamera put on, everything works fine. I wanted to ...
0
votes
1answer
59 views

libgdx - how to make enemies not overlap

I'm currently making a roguelike shooter in libgdx to get a better understanding of the library but I recently just stumped onto a problem where enemies would overlap each other while tracking the ...
0
votes
0answers
89 views

Java Game is slowing down

Every time I start the game it works fine but after a second everything starts to slow down almost exponentially and i am currently not able to find my mistake. Here is the main code: ...
0
votes
1answer
10 views

InputListener not working on a custom Actor

Right now I am working on a UI for my game. I'm adding my own UI elements to a group and adding that to a stage. But the listeners I'm adding to the actors are not firing off at all. I have looked on ...
0
votes
1answer
16 views

moving object while being snapped to another one lwjgl

hi now I want to move an object(cube) while being snapped to the surface of another one (sphere) with the same surface of the cube how can i achieve this in lwjgl here is a diagram. to describe my ...
-6
votes
1answer
87 views

I don't know what's wrong with the code

I am making a 2D game in java but it doesn't draw anything on the srceen and I don't know why. I have files(Main.java -> JFrame, Game.java -> GameLoop). Code: Main.java: ...
0
votes
1answer
31 views

libgdx - Problem occurring after collision detected

I have just implemented collision detection in my little 2d rpg-like game. I'm using Tiled for the maps, mechanism is simple - I have one layer called 'collision' in my tiled map, and while loading ...
-1
votes
1answer
53 views

Java 2d array to generate grid - java.lang.ArrayIndexOutOfBoundsException: length=4; index=-1

I am creating a Hashi Puzzle game (Islands and Bridges) I am generating a 2d grid with Islands that can be connected using bridges, I am also running a DFS algorithm to check if the map is solvable I ...
1
vote
1answer
39 views

Move object at angle like a sine wave

I currently have this code, which moves an object in a straight line at an angle, where "dir" is the angle. velX = (float)(Math.cos(Math.toRadians(dir))) * speed; ...