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
0
votes
0answers
16 views

How do I get the player from the LivingEntity so I can make this knockback effect on the amethyst sword?

Like the title says, how do I get the player from the LivingEntity so I can make this knockback effect on the amethyst sword? i want the amethyst sword to give knockback 10 to any entity i hit and in ...
0
votes
0answers
21 views

Delayed rendering of object sprite

I'm trying to replicate an odd feature of an 2.5D online Fighting Game named Grand Chase - that I believe it's is made to hide the latency between players. However, I do not know what exactly is this ...
2
votes
1answer
19 views

Building an LWJGL jar file - java.lang.NoClassDefFoundError

EDIT: Recently got it working by making a batch file that does this: set /p CP=<cp.txt java -cp %CP%;testing.jar me.pale.main.Main and cp.txt is this ...
1
vote
0answers
18 views

Looking for a 1.17 fabric minecraft mod that announces when nether portals are used

Does anyone know of a simple way to make a mod that puts a player's name and coords in chat on use of a nether portal (both ways), for a server that I have?
-1
votes
2answers
31 views

Rendering to BufferStrategy gives absolutely no output despite following instructions

I am following this YouTube tutorial by TheCherno to make 3D graphics using Java Standard Library. Display.java ...
-2
votes
0answers
33 views

Top view Water ripple effect in libgdx

Am working on a live wallpaper application in android studio using libgdx tool. how can make the water ripples on top view and 3d models looks inside the water. check in this video
1
vote
0answers
25 views

LibGDX: How to grow button height downwards in Table?

For my layout, I have a Table in which I add TextButtons with a height of 20. I also set the height of the table to 30. When I now increase the height of one button to 30, the height grows not ...
0
votes
0answers
12 views

Directional lighting messups with uniforms

Recently, I've been making a 3D game, and I have more progress! I am trying to implement lighting, but when I want to change the directional light uniform manually, it gets weird. Here's an example ...
0
votes
0answers
19 views

How to add level-by-level game camera following in 2D java game?

I've been working on my first game recently, and I've built a player tracking camera that works great, but my goal for the game would be to have a camera that is fixed for each area that the player ...
0
votes
0answers
36 views

How to change block color in Minecraft Forge 1.16?

I want to make grayscale mod in Minecraft Forge 1.16 and now, I want to change block color. Here is my codes: com/kg/kgmcmod/KGMCMod.java: ...
0
votes
1answer
26 views

opengl (lwjgl) - only white triangle gets rendered, vertex and fragment shader not responsive

Currently my program can only render my vertices as white and changes in my vertex and fragment shader don't change what gets rendered for some reason i.e: (...
0
votes
1answer
46 views

How resource-intensive is the java.awt.Graphics2D object at different screen resolutions?

I'm currently making a 2D RPG in pure Java (yes, I know other frameworks/engines exist xD). I just created a resizing algorithm and I've noticed that different resolutions result in different FPS ...
0
votes
0answers
23 views

How can I parse all items in the Minecraft chest getting all data from each item? (including custom item description on servers)

There is an items store on the server I'm playing on. What I would like to do is to parse all items in this store so I can quickly find a needed one. Since I'm 99% sure there is no ready-made ...
0
votes
0answers
16 views

Setting a TiledMapTiledLayer equal to another TiledMapTileLayer?

I am attempting to create a reset button in a simple isometric libgdx puzzle game I am making utilizing libgdx. I am using the TiledMap object in order to render my map. Within my code, I edit some ...
0
votes
1answer
33 views

Timing User Inputs for Inventory on 60UPS game loop

I'm making an inventory system for my pure Java game right now. Currently, the game runs at a 60UPS, and inputs are checked each update. I have inputs set up using arrays of the current update and ...
0
votes
2answers
50 views

How to port/convert a Java program to mobile?

I have coded a simple video game in Java. It works fine on all computers that have Java installed. However, I would really like to play it on my smartphone and it would also be nice to be able to play ...
1
vote
0answers
37 views

How to move player camera with mouse in LWJGL 2?

I making a 3D game like Minecraft in LWJGL 2 and now, I want to move player camera with mouse like Minecraft. Here are the codes I have: com/kg/kgcraft/KGCraft.java: ...
0
votes
1answer
61 views

Shaders overriding other shaders

Recently, I've been making a 3D game and I have been having trouble with making multiple shaders. I've researched this for a bit, and told that I had to use ...
0
votes
0answers
18 views

Slick-Utils texture not loading after binding to FBO

Recently, I am making a 3D game using LWJGL, and finally got framebuffer textures to work! The problem is, though, is that I think the default shader that is used for the cube doesn't work or the ...
0
votes
1answer
28 views

FBO not rendering or changing anything

Recently, I am making a 3D game. I want to do special post processing effects, like pixelization. I used this to load do everything with FBOS, but it's kindof weird... In some code for the ...
0
votes
2answers
64 views

Structuring a game in Java

I am currently programming my first game in Java and I'm having trouble structuring it. My biggest concern is regarding the game loop. Currently I have implemented a class with only a main function ...
0
votes
2answers
54 views

Placing a circle as close as possible to a specific coordinate without overlapping another circle

I am working on a 2D game in Java. My goal is to place a ball as close as possible to the center without overlapping the balls that are already there. How can this be done?
0
votes
0answers
7 views

Adding JPanel updates after being out of focus and back in focus of window

The title says it all, I am creating a chess game in Java using Swing, but using MouseListener and adding a JPanel using it, updates only after window goes out of focus, and then back in focus. Video ...
0
votes
0answers
9 views

How to create and add a JPanel from a class that is being extended by MouseListener

The title says it all. How can I create a JPanel from a MouseListener class? This is the code I have now: import java.awt.Color; import java.awt.Container; import ...
0
votes
0answers
20 views

Invisible pieces

I am making a chess game, and I made the background, but now, when I try to place the pieces, they are not added into the window. I tried instead of images text, but that doesn't show up neither. Code:...
0
votes
0answers
17 views

OpenGL never reverts to default FrameBuffer

So I'm trying to change the texture using FBOs, When I run it, The whole game gets drawn in the new FBO that I created then deleted, Here's the function ...
0
votes
1answer
26 views

Get on what tile has mouse clicked

I am writing a chess game using Java and Swing, And I wanted to get the tile position on which a mouse clicked. I searched through internet, but all of them were really off, and never accurate. When I ...
0
votes
0answers
20 views

Get tile position on what a mouse clicked [duplicate]

I am writing a chess game using Java and Swing, And I wanted to get the tile position on which a mouse clicked. I searched through internet, but all of them were really off, and never accurate. When I ...
2
votes
1answer
47 views

Where should I handle player movements in a Java Game?

I had an old pure Java 2D top-down game that I'm trying to reformat a bit. Before, I had a bit of a messy game loop that didn't use delta timing for any movements or animations. Now, I'm trying to ...
0
votes
0answers
22 views

How to set camera coordinates without making a Camera class?

Recently, I have been making a 3D game (and asking alot of questions about it), and yet again, I've run into another problem. I'm trying to rotate a cube across the "camera" origin, which is ...
1
vote
0answers
23 views

How to grab numbers in glVertex3f?

Recently, I've been making a game. I do not want to try to use VAOs and VBOs because I cannot wrap my head around that stuff. But, in order to use custom shaders, I need an arraylist of things to add ...
1
vote
2answers
118 views

How to use vertex and fragment shaders without using VBOs and VAOs?

Recently, I am trying to make a 3D game in LWJGL 2, not LWJGL 3, just because I am more familiar with LWJGL 2. Since LWJGL decided to shut down their legacy wiki website, I've been researching alot ...
0
votes
0answers
131 views

OpenGL Compute Shader vs Fragment Shader device support

I have a game with massively parallelizable logic, which I intend to write calculate on the GPU (Java/LibGDX). I am planning to implement a logic for it through a fragment shader, instead of a compute ...
0
votes
0answers
21 views

LWJGL - How to draw text on screen

After some months on libGDX, I chose to make a little java game library based on LWJGL. I have already tried to do it, but got stuck on this same problem: how render text on screen. The first time, I ...
0
votes
0answers
50 views

How to stop a decelarating object?

I am programming a 2D game. When a ball is launched it should decelerate and eventually come to a stop. I have implemented the deceleration part but when the ball nearly stops it starts accelerating. ...
0
votes
0answers
31 views

2D Isometric Movement - Move to Mouse Position

I'm developing a 2d isometric game on a engine made by myself (as a way to practice Java), however i'm stuck on what it seems to be a math problem. I wish I could have some help on how to implement a ...
0
votes
0answers
18 views

LibGDX - Render texture background twisted

I am developing a 2D survival game. In these days, without make some features, I am fixing some bug. There is one which I got stuck on: my map has a background made with grass, earth, desert, water ...
0
votes
1answer
35 views

Google Play Game Services Detecting Top 3 Players

I used Google Play Services Leaderboard in my Libgdx game. This is what I want to do; I would like to give awards to the best 3 players in this table. How can I help you? It automatically connects to ...
0
votes
0answers
44 views

libGDX box2D not setting user data

I am working about box2D. Even if I set userData, when I retrieve it via getUserData(), it returns null. Using debugger, I noticed that object passed to setUserData() is not null, but on the next ...
0
votes
1answer
55 views

Mcreator (Minecraft Mod-making) Compile Error

I'm trying to make a tool pack but every time I get the message: ...
0
votes
2answers
70 views

Vertexes passed to OpenGL becoming zero

I've got two methods of test code. The first uses a single VBO with the vertices and texture coordinates interwoven to draw a square to the window. The second uses an array of three VBOs to define the ...
0
votes
0answers
33 views

First person camera turning 3D

I know how to make the effect of moving an object on the z axis, and strafing, but how do you make the effect of the view turning, I don't use any 3d libraries or engine
1
vote
1answer
30 views

LibGDX Bounding system with tiledMap, 3D model player and ortho cam

Begins explaining my achieve: as I said in my last question, I am tryna makin' a 2D game with 3D player as Factorium. For hours I am tryna to make a kinda of bounding system: 1)Camera will follow ...
0
votes
0answers
36 views

How to restart my Snake game after Game Over

I'm new into programming and trying to implement a way to restart my snake game after the game is over. I tried several ways but none worked out for me. Can someone maybe help me? ...
0
votes
1answer
65 views

LibGDX make player rotate towards mouse pointer (Player facing mouse)

I am tryna makin' a 2D game with a 3D player (kinda of Factorium). I got stuck on the rotating of the player. I'd like it look always torwards to the mouse. e.g. If I move mouse on the top-left of the ...
0
votes
0answers
22 views

How to Show Daily Notification Using Libgdx Alarm Manager?

In a game written in Libgdx, I want to show users some daily notifications with the help of alarm manager. These notifications will be independent of Firebase. In other words, I will not send the ...
1
vote
0answers
43 views

How can I fix glitchy Collision on my 2D game?

Update: I fixed the Negative axis glitch but the Invisible wall glitch still exists I have made a 2D game in Java and I rewrote collision as I added chunks. I have been having problems with the ...
1
vote
1answer
42 views

Skill button cooldown

When a spell is on cooldown I display a "unfilling" black bar over the spell GUI until the cooldown is reached. Problem is when i have more than one second of cooldown the scale of the "...
0
votes
1answer
39 views

Check if point lies within coordinates

Let's say I have min (0,0,0) and max (1,1,1). If I have 3 points, lets say a (0.2,0.4,0.2) b (-0.5,0.8,0.2) c (2,0.3,0.1) How would I go about calculating it those points are within the coordinates ...
0
votes
1answer
37 views

Rotation on one object affects all others

I am making a game using LWJGL. I have encountered a problem with rotation, looked it up, found a solution, and added it, but it doesn't entirely work. In the code below, the bottom section is ...

1
2 3 4 5
68