2022 Developer Survey is open! Take survey.

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
1 vote
2 answers
20 views

Libgdx World point to screen point

It seems like converting a screen point to a world point is easy in libgdx but going from the world point to a screen point is quite tricky. So How do I convert a world point into a screen point?
user avatar
0 votes
0 answers
14 views

How to see if an entity is on screen for rendering in android?

I am trying to make my app render only entities that are on screen/in view at the given moment. How can I identify objects that are in view? App is in java.
user avatar
-1 votes
1 answer
47 views

Draw more sprite but they disappear

I have a array of sprite in a class "Enemy", I want to draw enemies in some positions, but when I draw one, the previous one disappears. ...
user avatar
0 votes
1 answer
55 views

Drawn enemy random on different position

I would like to insert random enemies in the map in different positions. It's possible? This is how i load image of enemy: Enemy.java: ...
user avatar
1 vote
1 answer
39 views

reposition object in circle

As you can see on the image, I have a p1 and p2 objects with (x,y) coordinates which I know the values, and I know radius of all these circle objects. However, I want to calculate new position x,y ...
user avatar
  • 115
1 vote
1 answer
17 views

Fade in with stage libgdx doesn't work

i use a stage on my background but the fadein doens't work. This is my code: ...
user avatar
1 vote
1 answer
36 views

Create a transition fade out in libgdx

How can i create a fade out in libgdx? I have a class "Menu" and with a fade, i want to change class to "Game". This is how i change class, from "Menu" to "Game"...
user avatar
3 votes
1 answer
752 views

LibGDX - My sprite glitches when it moves

My player sprite glitches when it moves across the screen. I've tried multiplying movements by delta time. I've tried rounding. It seems to do this completely at random. Sometimes I can move it all ...
user avatar
0 votes
0 answers
34 views

Having GUI on side rather than on game screen

How would I make it so that rather on the game screen the GUI is on the side of the screen and puts the game screen in its own little area so that its not covering part of the screen because right now ...
user avatar
  • 1
0 votes
0 answers
33 views

Can I use libgdx to create a game that runs on multiple devices?

I created my first game using Libgdx and Android Studio. The game runs smoothly on my Android phone. If you want to run it on an Apple phone with IOS or a computer with Linux etc. how could I do? I ...
user avatar
1 vote
0 answers
29 views

trying for a Typewriter effect on a JTextPane [closed]

i'm pretty new to coding (about 5 months) and i've been trying to make a custom terminal for a text based RPG. so far i have the terminal working the way it should but i'm looking for ways to rewrite ...
user avatar
0 votes
0 answers
30 views

Why does object not show?

I would like to tell about my home made exercising step to step with LWJGL and Java. But I don't understand why does matrix shut up? Transformation.java: ackage Example; ...
user avatar
0 votes
0 answers
26 views

How to not resize but move widgets when screen resized?

I have added buttons to my code, but when I go to "resize", they get bigger or wider and it looks very bad. How can I resize the window and keep the button aspect ratio? This is my code: 1)...
user avatar
0 votes
0 answers
14 views

SurfaceView shows black screen

My code does not work correctly. SurfaceView shows a black screen instead of Bitmaps. I make a game loop that doesn't depend on CPU, like Fix Your Timestep!, but I can't get it to work. ...
user avatar
  • 1
0 votes
0 answers
39 views

SurfaceView gameloop

Could you suggest an implementation of a game loop with interpolation for SurfaceView and thread? i have this, but it doesnt work. ...
user avatar
  • 1
0 votes
0 answers
63 views

Implementing material (mtl) files into objects (obj) in LWJGL/OpenGL

I have an object loader that takes in textures, but when I try making some textures, they never turn out exactly how I want. I found out that a lot of them take a colour I want in one place and put it ...
user avatar
  • 1
0 votes
0 answers
12 views

Raycasting fisheye effect [duplicate]

I am making a raycasting engine and I have an issue. There's this fisheye distortion happening. I tried the cosine solution, but that produces this circular effect: Here's the code I have (yes I ...
user avatar
0 votes
0 answers
20 views

MCP Decompile Errors (910)

I am installing MCP 910 for client development. When I decompile (decompile.sh) it troughs an error: ...
user avatar
0 votes
0 answers
14 views

How do I get "Gamer name" of current player from Google play games on android?

I'm using Google play games java sdk on android, logging through standard sign in Mechanism and requesting Games_Lite scope. After it succeeds I retrieve the Google account object but none of the ...
user avatar
  • 679
1 vote
0 answers
25 views

How to detect when the player presses the % key? [closed]

I want to use the "%" (percent) sign to do something in my game. I tried checking for KeyEvent.VK_DOLLAR but nothing happened. But it works perfectly with ...
user avatar
  • 15
0 votes
0 answers
47 views

Control sound volume in Java

I'm trying to control the volume of a file with keyinput. But all I get is a null error: Exception in thread "AWT-EventQueue-0" java.lang....
user avatar
  • 15
0 votes
1 answer
14 views

Raycaster Textures Scrolling?

I am making a raycaster, I Have currently got textures rendering, but with North and South faces it appears that the texture is scrolling infinitely. I have read Shimmering, scrolling/panning a ...
user avatar
1 vote
1 answer
39 views

How do I apply real time physics to a 2D game in Java?

I'm developing a 2D Brick Breaker style game in Java and want to apply some real time physics to it, especially to the paddle/ball interections. Nothing too complex; just applying some of the physics ...
user avatar
  • 13
1 vote
0 answers
27 views

Cellular Automata rendering

I am developing a Java game in my free time. The world/map consists of different kinds of cells: wood, snow, water, etc. The player can walk around and manipulate the terrain/cells with tools. ...
user avatar
0 votes
0 answers
19 views

Fabric Set Up issues

i am a total novice. i am trying to set up IntelliJ IDEA to edit a fabric mod. I've installed the Minecraft Development plugin and cloned the project using git hub desktop. then i went file>New>...
user avatar
0 votes
0 answers
28 views

Custom cursor not appear in screen

I am trying to create a custom cursor for my game the same way as described in de official documentation: https://libgdx.com/wiki/input/cursor-visibility-and-catching I have this in the constructor of ...
user avatar
0 votes
1 answer
65 views

Make types, levels, armor and weapons for an text based adventure game, java

So i plan on doing a text based adventure game in java. And right now iam planning my game. I came up with different types of player (exp. attacker, defender. etc) weapons, potions (health potions, ...
user avatar
  • 15
0 votes
1 answer
34 views

array of classes then give each class different properties, class selection random

So iam trying to practice java with a text based adventure game. This code gives out an enemy of an array(random) and then gives it a Randoam health between 0 and 100. What I want to do is give each ...
user avatar
  • 15
0 votes
1 answer
47 views

Libgdx OrthogonalTiledMapRenderer doesn't render properly

I will simply leave a clip of it as it's easier than describing the problem. https://imgur.com/a/kS7sXhW This is All the code that i have ...
user avatar
  • 37
0 votes
0 answers
47 views

Texture quality depends on the number of stacks/sectors of the sphere in OpenGL

I'm trying to display bitmaps taken from the camera in 3d spheres in OpenGL. The problem I faced is that these images are displayed in a very low resolution. After try some things, I realize that the ...
user avatar
  • 1
0 votes
0 answers
48 views

LibGDX sprite not moving with rotation

I have a player class and I'm trying to rotate the player and move it in the direction it's facing. The rotation works but I can't get the sprite to move. ...
user avatar
0 votes
1 answer
16 views

How to fix exception:Resource not found: testdata/alphamap.png?

I keep getting this exception:Resource not found: testdata/alphamap.png when trying to use Slick in my program. How can I resolve this error?
user avatar
0 votes
1 answer
26 views

Vector2.Zero unexpected behaviour when used to initialize Vector2

I have base class which contains a Vector2 velocity field, which I was initializing in the constructor with Vector2.Zero. But ...
user avatar
  • 103
0 votes
0 answers
13 views

LibGDX TextButton removes numbers from string

I have been having a unique problem with the LibGDX TextButton. In some cases, when setting the text of the button, the string lacks numbers (even though they are present in the string which can be ...
user avatar
  • 1
2 votes
1 answer
129 views

Use of java for game dev, must I pay for it?

I would like to start programming a video game using Java. This will be my first video game. I choose java because of portability, so I develop the game and then it run on every system. But now I read ...
user avatar
  • 23
0 votes
0 answers
19 views

How to draw skin face minecraft modding

I'm making a target hud which shows the information of the player you are fighting. I wanna take the face of the target and draw it on the screen. Any help?
user avatar
  • 1
2 votes
1 answer
95 views

Best Practice for Procedural Generation and Code Updates

I am using an initial seed to generate data. The question I have though is what is the best way to mantain the information with code updates. For example if I have something similar to: ...
user avatar
  • 121
1 vote
0 answers
26 views

Libgdx sidebar like in Tibia

I'm new to LibGDX and I'm trying to make a simple RPG game. I've implemented a basic movement & combat system. Now I would like to add a sidebar with inventory, character information etc. (like in ...
user avatar
2 votes
0 answers
123 views

How to get player coordinates in Minecraft Forge?

I'm currently working on a Minecraft mod (Minecraft 1.12.2) using Minecraft Forge where the player can use a hotkey to send out a "SOS" message in a discord-server using a discord-bot. This ...
user avatar
  • 21
0 votes
1 answer
35 views

LWJGL2 Camera Movement Stutter

I'm having quite some trouble with camera stutter in my LWJGL2 game. The stutter only occurs when moving the camera. When it stands still, the scene is rendered smoothly. I could verify that by ...
user avatar
0 votes
0 answers
58 views

How do I make something like Minecraft's crafting table

I'm making a mod for version 1.16. I want to make a crafting table with 3x3 grid which is automated. I need it to implement and read other mod recipes and minecraft recipes. I need to know how I to ...
user avatar
  • 1
0 votes
1 answer
61 views

Needs help on actually making the trigonometric function work as intended

...
user avatar
  • 37
1 vote
0 answers
33 views

How to find the locations of all the trees in Minecraft?

I am working on coding a bot for Minecraft in Java. The first step is to find trees in the world. I am using mcp-reborn (so basically the source code) but answers in Forge can also be useful to me. I ...
user avatar
1 vote
1 answer
50 views

ParticleEffect using TextureAtlas in libGDX

I am using ParticleEffect with a texture stored inside TextureAtlas. The code below shows how I load a particle: ...
user avatar
  • 13
1 vote
2 answers
280 views

How would I actually implement A* pathfinding in a 3D world?

I have been trying to implement pathfinding in Minecraft for a while. Everything is in blocks, so this shouldn't be too difficult. I have gone through a lot of different posts and articles but I haven'...
user avatar
2 votes
1 answer
49 views

Only Square Textures loading correctly (Beginner question)

(Sorry if this has already been asked, I couldn't find any other question or source describing my problem) Okay so basically Square textures load and display just fine. But for some reason, when ...
user avatar
0 votes
0 answers
97 views

InvalidPluginException: Unsupported API version in Minecraft Mod

build.gradle For Compile ...
user avatar
  • 1
1 vote
0 answers
78 views

Java/LWJGL 3 Optimization and Render error

(I asked the same question on StackOverflow but didn't got an answer. It's the first time I post here so idk if this is not allowed or anything, so if it is please tell me) I was following ThinMatrix'...
user avatar
1 vote
2 answers
136 views

I'm following a tutorial but I don't get the same result; why are the raytraced shadows not working?

I followed this tutorial called "Ray Tracing in One Weekend" by Peter Shirley. And I implemented the java version of it for studying Ray Tracing. Everything was all right until Diffuse ...
user avatar
  • 21
1 vote
2 answers
228 views

Shooting from Gun in LibGDX

I'm trying to shoot a bullet from the tip of a gun. This gun is a Sprite object and it is constantly being rotated to point towards the mouse. The issue is that the point to shoot the bullet from is ...
user avatar

1
2 3 4 5
68