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.

learn more… | top users | synonyms

1
vote
1answer
55 views

Best way to deal with Collision in JavaFX

This question I'ts no exactly a fix for the current game I'm working on, but I am showing it as an example to explain my problem. I just want to know the best way to handle collision in JavaFX. My ...
0
votes
0answers
16 views

balloon ligher than air with libgdx, impementation of FixtureDef.density, gravityScale, linearDamping?

I use libGdx/box2d's physic. My intention is to create a balloon filled with helium (a body, what hovers above a surface, if we apply a little force to it - it moves fast but not far, if we push ...
1
vote
2answers
134 views

Libgdx: different speed on different devices

I am running a simple Libgdx app that I have wrote, on my Android phone and Android tablet and I am getting the unexpected result of having different velocities when a body is moved. To move the body ...
0
votes
1answer
14 views

How can I add extensions to libGDX

I had a problem with my Font in a game I am developing in libGdx. After some googling I was instructed to use the following code: private void createFonts() { FileHandle fontFile = ...
0
votes
0answers
5 views

Box2D - Slow movement on bodies when some are above others

I set a random position around the screen to some circle bodies with 1f density. And when some of them are above other bodies, they move until they dont touch each to other. I want this movement, but ...
0
votes
1answer
22 views

How do I query a LibGDX Box2DLights “light” and “dark” regions?

I have lighting implemented using Box2dLight. I want to update/render things inside the player's PointLight area. Stuff in the dark area should not be rendered. How can I find which areas are lit or ...
0
votes
1answer
23 views

Scene2D: How to use Image.setDrawable()

I'm trying to change the texture of an Image actor on my Scene2D stage, however I can't seem to get it working. It seems like setDrawable() doesn't really do anything. For example, this will make ...
0
votes
1answer
32 views

android canvas rope swing

I'm creating the code, where a player swinging on a rope for the moment I got this double angle = Math.atan2(player_y - center_y, player_x - center_x) - Math.atan2(end_y - center_y, end_x - ...
0
votes
3answers
90 views

Procedural generation of stars in the background with given random seed

I want to generate stars (actually a 2d vector) in the background. The player is moving left and right endlessly. When the player moves the stars, which aren't in sight anymore, should be deleted from ...
0
votes
1answer
80 views

Java OpenGL Perspective matrix not working

I'm trying to render a simple triangle with OpenGL in Java using LWJGL3. Everything is working great, but the projection matrix (perspective) is not working. In C++ I just used to apply the ...
0
votes
1answer
66 views

AI for Minesweeper like game

I am currently developing a Puzzle/RPG game which works a little bit like Minesweeper. You have a Field of Tiles and 2, 3 or 4 different colors from which you can choose. Now you have to uncover tiles ...
0
votes
1answer
22 views

glGenArrays - This functionality is not available

Whenever I call glGenVertexArrays(), I get the following exception: Exception in thread "main" java.lang.IllegalStateException: This functionality is not available. at ...
2
votes
1answer
72 views

(Minecraft) MoveHelper for custom entity not updating

I'm trying to create a shark mob for minecraft 1.8 (using Forge 1.8). Since it's a water mob, the movement functions need to be edited to allow it to path correctly in water. However, after ...
0
votes
1answer
25 views

How to create objects having attributes from differents java class

I have a class Creature with another class Flying and Undead that extends Creature. How could I create a object that have both the Flying and Undead attributes? class Creature(){ String name; public ...
0
votes
1answer
55 views

Getting positions of static entities in a Tiled Map

I'm creating a 2D game that uses a Tiled Map with an underlying 2D array to store where entities are in the world. At the moment, I'm just creating one instance of an entity, assigning it a number, ...
0
votes
0answers
16 views

Java how to wrap text

Hello I have a game where you hack into computers(not real ones :P ). You can type the command ping and it pings to your address in real life. It returns something like this: Pinging 192.168.6.1 with ...
0
votes
1answer
194 views

Client side latency when using prediction

I've implemented Client-Side prediction into my game, where when input is received by the client, it first sends it to the server and then acts upon it just as the server will, to reduce the ...
3
votes
2answers
5k views

Problem to match font size to the screen resolution in libgdx

I'm having problems to show text on my game at same size on different screens, and I did a simple test. This test consists to show a text fitting at the screen, I want the text has the same size ...
1
vote
2answers
61 views

How can check a collision between 2 non-axis aligned boxes?

I'm making a simple and easy game and I need to detect the collision between 2 boxes. It only needs to return trueor false, no physics involved. I started working and couldn't find an algorithm that ...
0
votes
1answer
23 views

Should System.nanoTime() in Java be explicitly casted to a double for game loop?

I am writing a game loop in Java and trying to calculator deltas. When attempting to get the current time, the following does not give me an error in my IDE. However the function returning a double, ...
0
votes
0answers
27 views

How to make a 2d game using java netbeans? [on hold]

I'm an IT student, but my problem is my professor is just giving us codes but not explaining what is it for. Now, in our finals, our finals exam is we'll be making a 2d game using java. And I have no ...
0
votes
1answer
36 views

LibGDX - how to detect touchUp with GestureListener?

I'm making a game and I have implemented GestureListener as my inputprocessor. It came with a bunch of methods such as fling, pan, tap etc etc including touchDown. However, there is no touchUp method! ...
0
votes
1answer
16 views

Triangle data structure not working for LoD algorithm

I would like to implement a LoD algorithm to my 3D game in order to simplify meshes at certain distances from the player. My meshes are created / loaded using a VBO, so the vertex data is stored in a ...
0
votes
1answer
30 views

How can I add a transparent overlay to a UI in libGDX?

I am attempting to use the following code shapeRenderer.begin(ShapeRenderer.ShapeType.Filled); shapeRenderer.setColor(3,3,3,.3f); shapeRenderer.rect(0,0,gameWidth,gameHeight); ...
0
votes
1answer
20 views

LibGDX viewport touch coordinates transformation

I've been trying to get LibGDX's viewport and camera unproject() to work and so far none of the tutorials/answers I've found have worked for me. I have a game window of 840x480 units with ...
0
votes
2answers
323 views

LibGDX how to change animations

I have a Player Class and i have 3 different Animations for it. I can render them perfectly but i don't know how to change from one animation to another. For exmaple i have 3 animations, one for ...
7
votes
1answer
133 views

Tiling perlin noise seamlessly, but without repeating to generate an infinite 3D world

I have been working on a 3D game in java using LWJGL for a while now. I am trying to make procedurally generated infinite 3D terrain that is generated around the player. So far I have: 3D terrain ...
0
votes
0answers
34 views

Libgdx performance on old devices

I'm developing a game in Java for Android, using LibGDX. I'm using Nexus 5 to test my game most of the time and it works great (Minimum FPS it gets is 57 out of 60). Recently I ran my game in Galaxy ...
1
vote
1answer
31 views

Java - Trouble with recursion and rectangle placement

I am using Android API's and using the RectF class for rectangles. I have a list of blocks that are on the screen at one time. Each block is given a random position, and then I go through all of the ...
1
vote
4answers
52 views

OpenGL calls from a different thread?

I understand OpenGL is not thread-safe, but at the same time, Google seems to be giving me mixed responses. I have a LibGDX game that functions normally, UI/rendering/logic on the same thread, ...
0
votes
1answer
321 views

Android Game-Loop (rendering & logic removed, but still 'skipping frames')

Overview Guys really hopeing for some help here. My game loop is based on code from Fix Your Timestep!. I've read the article more than a few times, but I can't quite work out what exactly is ...
0
votes
2answers
1k views

libgdx actors and instant actions

I'm having trouble with actors and actions. I have a list of actors, they all have either no action, or 1 sequence action This sequence action has either : a couple of actions (some are instant, ...
0
votes
0answers
14 views

GLFW/LWJGL black screen flicker issue

Im having a problem with creating a borderless fullscreen window in LWJGL using GLFW. It creates the (in this case black - as intended) window, however when the focus changes (f.e. tabbing int/out), ...
0
votes
1answer
26 views

libGDX: Why doesn't Gdx.input.isKeyJustPressed() work?

I'm trying to use the method Gdx.input.isKeyJustPressed() to check if the Android BACK button was just pressed. I don't want to use the Gdx.input.isKeyPressed method to avoid multiple calls. Here is ...
2
votes
1answer
802 views

libGDX using Stage and Actor produces different camera angles on desktop and Android Phone

libGDX using Stage and Actor produces different camera angles on desktop and Android Phone. Here are pictures demonstrating the problem: http://brandonyuh.minus.com/mFpdTSgN17VUq On the desktop ...
0
votes
0answers
24 views

How to “pause” stage actors listeners

I have a problem with multiple stages and listeners in libGDX. I have GameScreen with gameStage (contains game elements), uiStage (score label and pause button) and pauseStage (resume, restart and ...
0
votes
1answer
232 views

Multiplying by delta not giving smooth movement

I started working on my first proper game but reached a problem straight away. In short I have a game that runs most of the time at 60 fps. ( I am using Libgdx a popular Java framework) but my game ...
1
vote
2answers
87 views

LibGDX - Rendering things in different classes

thanks for your time! I'm really new to LibGDX (and Java itself). Which approach should I use to render my different game parts? I want to show a background, the main character, a bunch of enemies ...
1
vote
2answers
89 views

Tilesets - how to make the pink color appear transparent

recently I searched for some free to use Tilesets on the internet. And wherever I found a sheet of sprites there is this pink color in the background. i know that all the spots having that color ...
-1
votes
0answers
43 views

Is it worth it to learn directx? [closed]

for the last few months ive been learning opengl(in python, java and c++), I know that directx is windows exclusive and (unless you count bindings) is exclusive to c++, but other than that what are ...
0
votes
0answers
19 views

Change font size in slick2D

You may have heard this question many times before, but there is nobody on the internet that I have found that can actually help. My question is, is it even possible to change the font size in ...
1
vote
2answers
130 views

OpenGL Vertex Array Object(VAO)

I have drawn a triangle and a square using open gl and everything was fine. I have then tried to draw the same triangle and square, while implementing VAO's and now I only get a white triangle - ...
-1
votes
0answers
49 views

MMO: How is Item/Money Dupe working? how to prevent it? [closed]

First, I have seen Preventing item duplication?, but it´s not what I am looking for. 1.) How are these Dupes working in general? I thought that they occur in Combination with Databases and missing ...
0
votes
2answers
225 views

get View from LibGDX for Android

I am making a LibGDX app, and I need to get the view to put to an Android app. Here is the code to get the view: package jangkoo.game.shadowfiend.android; import ...
0
votes
0answers
57 views

OpenGL camera scrolling too fast

I'm using the code from this tutorial but in Java and LWJGL. The problem is I want the player to click and drag around the world with the mouse. I tried adding the mouse dx (velocity) to the camera ...
1
vote
1answer
233 views

Structure gameobjects and call events

I'm working on a 2D tile based game in which the player interacts with other game objects (chests, AI, Doors, Houses etc...). The entire map will be stored in a file which I can read. When loading the ...
1
vote
1answer
33 views

Objects phasing through each other in physics engine

I'm writing my own physics engine right now (following this tutorial), but I'm running into some problems. Sometimes on collision, objects will just phase through each other instead of bouncing off of ...
2
votes
1answer
872 views

How to implement the server-side game loop?

The server needs to handle the physics, because all the movement will be handled by it. So for that I need a game loop. The thing is that the server doesn't have the render part, it's just a console. ...
0
votes
1answer
54 views

Rotate heading relative to agent's local space

I'm having a little trouble translating a point in my game's world space to an object's local space. I have a cannon in my game with a normalized heading vector that's always supposed to point in the ...
3
votes
1answer
1k views

Libgdx - IsometricTiledMapRenderer and light shading

I am wondering if there is any way to simulate light shading in Libgdx using an IsometricTiledMapRenderer. Here is my code to draw an isometric map, it's able to be moved around with the mouse and ...