Stack Exchange Network

Stack Exchange network consists of 175 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
30 views

Project organization for a multiplayer client-server game

I'm programming a game 100% in Java but I'm having some issues concerning the final games architecture. I plan on having two separate projects: one that will hold the client side of communication ...
0
votes
1answer
39 views

JOGL KeyListener not functioning properly

I have been having a problem with the JOGL KeyListener where if I hold down a key, it would register the key as pressed for around 1 second, then it would start quickly switching back and forth ...
0
votes
1answer
82 views

How do I wait till an animation is finished?

I am currently working on a Warfare 1917 like game. Right now I am trying to get the combat system working. I have made animations for a running and shooting soldier. It takes exactly 0.5 seconds till ...
1
vote
0answers
48 views

Making a Asteroids game two player

I have a game - Asteroids - that is currently only a single player game. What I want to do is to have 2 players be able to play at the same time by competing in how many Asteroids they can shoot. ...
0
votes
0answers
5 views

Slick2D - Update method interrupted while dragging window

I am currently making a project using Java and Slick2D (yes I know there is no support for it anymore, but it is an old project I wish to complete, and it serves me fine so far). There is only one ...
-1
votes
0answers
30 views

What is best way to create interface movement animations

I wonder what is the best way to create interface animations, like moving up , jumping, swinging ... etc or glowing button on libGDX library?
0
votes
0answers
25 views

How could the DOS Quake 1's pixelated look be achived with openGL, for example: Limiting the Colors to 256? [duplicate]

I want to achive the DOS Quake 1's pixelated look and limit the displayed colors to 256 in my engine, but I don't know how to do that. And also, I'm using java. Here is the code of my Fragment shader:...
1
vote
1answer
28 views

How to decelerate Ship using Vector Objects in Java

I am developing an Asteroids type game in Java, using a custom Vector2D class for the Ship. I have a vector object for its position, direction and velocity. I am having an issue with the ship ...
6
votes
3answers
122 views

MUD programming: socket handling

I'd like to build a multi user dungeon in Java/C# (also open to other suggestions). Below I have listed two ways of handling connections, and would like to know which would be the recommended way? I ...
0
votes
1answer
19 views

Trying to understand why libgdx wipes existing models when creating new ones

I'm coding a simulated brain and I'd like to make an arrow appear when one cell connects to another cell. My output without generating an arrow looks like this: Where each block rendered represents ...
0
votes
0answers
38 views

Error: Program type already present: android.support.v4.app.NavUtils

Every time I try to build an APK file, it gives me an error. I fix one and then I get another and another. This was my last try: My gradle file: ...
0
votes
1answer
31 views

Orbital rotation equation

I am developing a space sandbox (3D). Now I am working on an asteroid belt around a planet. I have an Asteroid class and an ...
1
vote
0answers
33 views

No-duplicate collection without iterator allocation [closed]

Problem I need a collection with non-duplicate values minimising memory allocation during access operations. I am prepared to compromise with a slight decrease of performance to make up for the ...
-2
votes
0answers
23 views

Unity job is fail error [duplicate]

didn't have a problem in advance but after updating the unity and adding the unity ads I started getting this error. please help.
0
votes
1answer
62 views

LibGDX: How to make an object falls with random speed

I'm trying to make an object (ball) fall into position Y and when the ball collides with the base. The sprite changes and along with the change I want the speed of the fall to change according to the ...
0
votes
2answers
53 views

LIBGDX JAVA, Error reading .JSON File

I get an error every time I try to parse this .json file. Here is the error: Exception in thread "LWJGL Application" com.badlogic.gdx.utils.SerializationException: Error reading file: skin/glassy-ui....
0
votes
0answers
47 views

How can I send a Base64 Image?

I'm looking to make a post request with a base64 image. When I make the request, I get an error called "ERROR_IMAGE_SIZE_0" ...
0
votes
0answers
32 views

Friction makes entity move slightly backwards

I'm having some trouble getting my friction to act properly in my game. My current goal is to add a dash move - which is working fine except that a bug with the friction is messing with me. The Dash ...
-1
votes
0answers
34 views

The texture will follow the mouse movement

How do I make this.I have texture and I want this texture moving with mouse movement program ss ...
0
votes
2answers
117 views

JavaFX - How do I create a health bar?

I tried searching online on how to implement health bar with Java FX in a 2D side-view Java fighting game but I can only find those that goes with 'awt' and 'Swing'. The health bar I'm picturing are ...
1
vote
1answer
56 views

Composing Game Metrics

So I'm running into a bit of a roadblock with the way I'm currently keeping track of game metrics. By "metrics", I mean little bits of information that I can compose together to get useful information ...
0
votes
0answers
28 views

Detect how many blocks can be moved given a grid of blocks

Let G be a grid of booleans where true means a block is there and false means there isn't a block there. Let P be the player, ...
0
votes
0answers
33 views

Specular/Diffuse light on an icosahedron opengl

I'm having a problem with my model here. I draw an icosahedron using GLUT, and the edge length is set to 0.8. The info of the coordinates are listed below: (X and Z are calculated since our edge ...
0
votes
1answer
57 views

How do I implement 3D A* Pathfinding in libgdx?

I am using BDX (Blender with libgdx engine) to create my game. I am not sure on how to implement 3D path finding using A* search. I looked into gdx-ai, but that is for 2D.
2
votes
2answers
44 views

Parabolic Jump Libgdx Without Box2D and With Vectors

I have tried to write a jump method that sketches out a parabolic jump but it results in either no movement, or a jerky upward movement when I try to scale up dt. I have the following things defined: ...
0
votes
1answer
43 views

Split tile based map file into multiple files

I have a gigantic map file (1440x1080) that I wish to split into smaller files (45x45) for faster client reading. I plan to split offline (when running DEV server) so I am not too worried about speed....
0
votes
0answers
21 views

Fail to Start android service in android studio Unity

I have written a service file in android studio like: Manifest file: ...
0
votes
2answers
223 views

Algorithm to detect impossible scenarios

I'm making a simple game where a surface is split up into 4 parts, rows, obstacles spawn in them, and a player tries to dodge them. Up to 3 obstacles are generated in each row, and this can lead to ...
0
votes
0answers
32 views

Item collision detection doesn't work

My GameWorld constructor has the following code inside it. ...
0
votes
0answers
58 views

Android studio background GPS service call and Unity

If I have a service file written like this in android studio: Manifest file: ...
0
votes
0answers
25 views

Low fps when drawing semi-transparent color to Canvas (java)

I'm making an Android game and I want to make a darkened background I try to do this with: canvas.drawColor(0x99000000); This works but my framerate drops from a ...
0
votes
0answers
41 views

Keyboard arrow Navigation

My crossword is a table made with <td> tags. The input boxes are textboxes (input="text"), styled with CSS. My question is how do you get the focus to the ...
0
votes
0answers
14 views

Box2D rotational issues

I am making a game in Android Studio using LibGDX. My player is supposed to fly up and down, and angle itself accordingly(lean back/up when going up, lean forward/down when going down). I am having ...
0
votes
1answer
153 views

Map generator sometimes doesn't work

I am making a dungeon map generator and am currently trying to make it place empty rooms. It first checks if the space is empty and then places a room. The problem is that most of the times it ...
1
vote
1answer
64 views

Can't get AABB Collision to work properly

This is the code I'm using to resolve collisions on the players left side. It works when I'm on the ground, but if I'm falling, it does not work. ...
0
votes
1answer
45 views

Why is this LIBGDX Action behavior THE EXACT OPPOSITE of what I expect?

Here is a code snippet of the relevant section in my render loop. My intention was to make the actor who was currently focused blinking, to indicate that it was the currently selected UI element. But ...
1
vote
0answers
22 views

Uniform lighting when there are multiple light sources

I'm writing a 2d game where there are walls and the NPCs can only see what is within their line of site. To do this I'm using Box2dLights so the walls create shadows. The problem I'm having is ...
1
vote
1answer
77 views

Shadow artifacts/acne on block intersections

This is using the default shader and depth shader from LibGdx. It creates lines at the blocks intersections. This is what I use to create the blocks models for now: ...
0
votes
0answers
36 views

Large game statistics database management

I am making a management game in Java with a farming theme. I am rather beginner in software development and every steps requires lots of thoughts. I am at a point now that I want to log and keep ...
0
votes
0answers
45 views

How should I send large amounts of data from java to c++ (within the same process)

I'm writing a game that is mostly in Java (because that's the language I'm most comfortable with) while the graphics are in C++ (because of speed, and because the Vulkan API is hard enough to learn ...
0
votes
1answer
30 views

Spine runtime for libgdx clipped rendering issue

I've started to play with the Spine for libgdx runtime in Java. But I can't seem to render without some sort triangular clipping. The code is based on the Spine examples: ...
1
vote
2answers
35 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
42 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
2answers
92 views

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

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 ...
1
vote
1answer
111 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
57 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
1answer
22 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/...
0
votes
1answer
150 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 ...
-1
votes
1answer
50 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
61 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 ...