Java is both a popular programming language and runtime environment which allows Java programs to run unchanged on most hardware and software platforms.

learn more… | top users | synonyms

0
votes
0answers
7 views

Android: How to scale the imageView?

Right now my application allows the user to double-tap a bitmap image and a circle is drawn exactly where the user double-taps. Now I want to implement a button that can resize the circle that is ...
0
votes
0answers
9 views

LibGDX Tiled Map - how to get embedded objects

I am using LibGDX to learn Game Development. I have reached the phase I am learning to use Tiled Maps. In Tiled map editor, there is a feature where we can pick a tile in the tile set, go to View -> ...
0
votes
1answer
23 views

LWJGL 3, VAO and Shader not rendering [on hold]

X-post from Stack Overflow because its receiving little attention. I am using LWJGL 3 and Shaders with VAO's. My current implementation does not draw the VAO when using the shaders. However the VAO ...
-1
votes
0answers
12 views

Sequential Memory Game, Incrementing Images Showing all at Once not One at a Time

I am making a sequential memory game, each time a user gets the sequence correct an extra image is added to the sequence. The problem I am having is all the images flash at once not one at a time. For ...
0
votes
1answer
21 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 ...
-1
votes
1answer
10 views

libGDX's 2D particle editor launching incorrectly

What's going on? Here's my process: I first right-click the referenced library for gdx-tools.jar in Eclipse: I then search for the particle-editor class: It opens successfully, but half of the ...
0
votes
0answers
36 views

Java game check if any of the booleans are true? [on hold]

I have a game where you place blocks. At the moment you can place blocks on blocks I don't want that. In the listen class I do if(canplacetile){ createtile(x,y); } In my main ...
0
votes
1answer
26 views

Is there any case to mix Android UI with LibGDX?

my question is about creating "non-playable" screens in games with the help of native android tools. For example, I have an Android LibGDX game (singleplatform), what should I use to provide start ...
0
votes
1answer
31 views

Client code handling its own generics when returned by an engine

I'm writing a game engine in Java 8, and have prototype client code written in Groovy. New Game objects can be created with a builder which defines everything which fills in the blanks. To simplify ...
0
votes
0answers
7 views

Libgdx - How to change GestureListener pan finger sensibility?

I implemented GestureListener in my Overlap2dStage to pan the camera when the player drags its finger over the screen. But I also have some actors that extend InputAdapter to detect when the user ...
0
votes
0answers
23 views

JBullet move object rigidbody in code?

I am trying to move an object's Transform (of a coded class, these are for the rendering engine), then convert it into a JBullet Transform. After that, I try to apply any movement to the JBullet ...
-2
votes
0answers
30 views

Java how to not place a block on top of another block? [on hold]

Hello I have a game where you build ships you place blocks by left clicking your mouse. Everything works great in this game except you can place tiles on top of other tiles and I don't know how to ...
-2
votes
2answers
74 views

Minesweeper number placement [on hold]

My professor gave us a project: make a minesweeper clone. However, he said that he will give bonus points for the 3 fastest algorithms for board generation. I'm currently doing the algorithm that ...
1
vote
1answer
32 views

(Java) Trying to animate an arraylist of coins with a (working) animation class

I have a coin class which takes in an integer numOfCoinsand an enum LayoutType, which can be linear or curved. A linear layout displays the coins in a straight line one after the other - we'll work ...
0
votes
0answers
47 views

Shooting game collision detection [on hold]

I am making a space shooting game. I have a player controlled spaceship, enemy spaceship and bullets, and maybe some additional interact-able entities. How should I handle collision detection? Should ...
1
vote
0answers
27 views

Using Box2D in LibGDX, is there a reason a fixture set to be a sensor would only -sometimes- detect a collision?

I am working on a 2D game in LibGDX. Currently, I am testing interactions between a player's weapon and enemies - in particular, a sword and an enemy monster. The player has a hurtbox and the sword ...
1
vote
1answer
158 views

How do I reverse this function?

I'm working on an isometric tile rendering engine and I need to reverse a function I used to translate the Cartesian coordinates into isometric coordinates. I've already written a function for this, ...
0
votes
1answer
100 views

Java Game How to find the x and y for a tile?

Hello I have a java game where you build houses I want to be able to dag my mouse form point a to point b and I want to fill that area with tiles when I release the mouse. What I cant do is get the ...
0
votes
0answers
44 views

Trouble with Raycast Selection using OpenGL

I am currently having trouble with a custom model editor in which I want to implement model selection (eventually featuring face selection to have something like "click-and-drag" to extend the cubes). ...
0
votes
2answers
72 views

How do I show damage to an enemy? [on hold]

I have a Player and an Enemy, both with damage values and health. I am trying to add something that will show how much damage is done to the Enemy with each attack. I want it to show above the Enemy, ...
0
votes
0answers
18 views

Java Slick2D rotating a Shape using transform(Transform.createRotateTransform())

I have spent most of the day trying to debug this tiny piece of code, and I can't for the life of me figure it out. I'm making a pong game for the Mini Ludum Dare currently going on. I am programming ...
0
votes
0answers
35 views

SDL/SFML if i have only got experience in java? [closed]

My question is, If i have a reasonable amount of experience in Java, would it be difficult for me to use a library like SDL or SFML. Should I learn more about c/c++ first or should I just jump in ...
0
votes
1answer
27 views

LibGdx Table not firing touch events

I can easily add listeners to the actors within a table, and they will fire events, but if I want an entire to table to have 1 listener and do not care to have differentiated effects depending on ...
0
votes
0answers
17 views

Lwjgl terrain generation [closed]

I am currently making a game and am wondering how one would go about making a terrain generator. Currently I have a mesh class to load all of the vertices and indices into, but how do I generate those ...
0
votes
0answers
11 views

Java how to fill a selected area with tiles [duplicate]

Hello this is my last try at asking this question because my other ones weren't great. I have a game where you build space ships. You can drag the mouse from one point to another and it will draw a ...
-2
votes
0answers
16 views

java filling a rectangle with blocks [closed]

Hello I have a game like 2d space engineers where you place blocks to build a space ship I want to be able to drag my mouse from 1 point to another and be drawing rectangle in that area then when the ...
1
vote
0answers
26 views

OpenGL enabled Java game not detected by Fraps

Recently I found out that I could enable OpenGL hardware acceleration in my java game with the line System.setProperty("sun.java2d.opengl", "True"); Initial tests showed a big boost in performance. ...
0
votes
0answers
37 views

Dijkstra Pathfinding in Libgdx, some minor problems

I'm having some problems with my Dijkstra implementation in Libgdx. I understand that there are already AI libraries that can probably do this much simplier but this is a school assignment so i'm ...
0
votes
1answer
49 views

What is the difference between .obj files and Collada files? [closed]

I am currently making a game in java using LWJGL 2.9 and I am wondering what the difference between the .obj format and .dae format is. Currently I can load .obj files and would like to load .dae ...
0
votes
0answers
13 views

get the closest points [duplicate]

Let's say I have a bunch of points: What is the best way to get a certain amount of closest neighbors. For example I wan't the 8 closest points for point no 57. This without using brute force. O ...
0
votes
0answers
20 views

java grouping blocks together to form one object [closed]

Hello I have a game like 2d space engineers where you place blocks to build a space ship I want to be able to see which blocks are connected to each other and be able to move them all together when I ...
0
votes
1answer
35 views

JNI multidimensional array as return value

I have some C++ code that I wrote to generate voxel terrain and would like to access it in JAVA. you pass it three integers; the seed and the coordinates of the chunk that it is generating ...
0
votes
0answers
13 views

Stack matrix affecting shooting mechanics

I attempted to make a scroller game using parallax scrolling in LWJGL. Everything is fine but I'm having trouble with the matrix stack and the bullets. So basically when I shoot the bullet it moves ...
1
vote
1answer
31 views

OrthographicCamera and viewport not giving expected effect

I recently asked a question about this area that I think was too broad, so I will try a new approach. I have the following code I am experimenting with: batch = new SpriteBatch(); ...
0
votes
1answer
53 views

How can I split up a large model into an octree codewise?

For collision detection, I am attempting to split up a large model into an octree. If we take this black thing thing to be the ship (104,000 vertices): Then I would like to split up the faces I ...
0
votes
0answers
26 views

unity plugin for android (failed to receive dispatch signal error in logcat) [on hold]

i m trying to make a unity plugin for android. The plugin will show the native android dialog box when clicked on a button in unity. But when i click the button an error arises in the catlog and ...
0
votes
0answers
87 views

In a 2D Java Swing game, how would I rotate my camera or map? [on hold]

I am creating a 2D Java game from scratch and would like to know how I would rotate my camera or map. The way my game works is it uses a raster image in which the pixel array is edited by the screen ...
0
votes
0answers
7 views

Running different methods within an object depending on the 'type' of object [migrated]

I'm trying to manage the power-ups in my game. Lets say I have 7 'platforms' in my game and I want to randomly spawn a power-up with a max of 1 per platform (this is a vertically scrolling 'infinite' ...
0
votes
0answers
25 views

Can't perform normal jump after applying revolute joint

I have encountered the following problem: I have two PolygonShapes which I had connected with a RevoluteJoint. The first body is called square the second is called weapon, before connecting the two ...
0
votes
0answers
26 views

java building Game Rotating a tile image [closed]

Hello I have a game where you build spaceships. it is 2d. I have all the tile images made in paint.net they are 20 x 20 pixels. they all face upwards(north or whatever). I want to rotate them when the ...
0
votes
0answers
27 views

How do I make a Slick2D TextArea display newlines?

Whenever I press the Enter-key my Slick2D TextArea does not go to the next line. How can I make it do that? Here is the code that involves the TextArea: private TextField ta; public void ...
0
votes
0answers
21 views

LWJGL: getDisplayModes() on Linux with two monitors

When calling getDisplayModes() on a Linux machine with two monitors I only get one single resolution, that is, the current resolution set on the main monitor. However, calling xrandr directly gives me ...
0
votes
0answers
23 views

How to use Android Sensor, only in x axis

I have seen some tutorials but they are very complicated and they are about the three axes (x,y,z). So I want a code that moves an object or more (for example) to the right or the left when the ...
0
votes
1answer
42 views

java Move vehicle towards the mouse

Hello I have a game like asteroids and I have my ship on the screen and he points towards the mouse. I want to know how to move towards the mouse so if I press w I will drive towards the mouse and if ...
0
votes
0answers
7 views

Find fastest rotation left or right to face an object [duplicate]

im working on a competition where i am creating an AI for a game that the host has published and made for this event, i have two commands for turning my car and that is left and right, spinning on the ...
-1
votes
2answers
51 views

How to make a proper cache on user computer?

Currently when launching the client of the game, it connects to the server and loads all the cachedata in a normal form (= folders, .txt files and .png files). However I don't like that the players ...
0
votes
0answers
42 views

Problem with collision detection , Libgdx [on hold]

I have a main character called main_sprite and I need to check for collision with another object called enemySprite . In case there is a collision, it should set velocity to 0. Here are my classes : ...
1
vote
1answer
65 views

LibGdx - Move sprite in the direction of other sprite

I'm kind new to LibGdx and I'm still learning. I'm working on a small game project to learn this nice framework. However, I'm having some issues with my game. My game is a top down shooter. There is a ...
0
votes
0answers
15 views

Libgdx. Sprite won't stop moving;

I can't stop a sprite from moving. Here's my code: boolean moving; Gdx.input.setInputProcessor(new Input(){ public boolean touchDown(int screenX, int screenY, int pointer, int ...
1
vote
1answer
44 views

How do I make my main character move towards an object? LibGDX/Java

What I want to happen is for my player to bounce from spring to another. For example take the illustration below: Here's my code (what I've tried to do so far). This gets called in an ...