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
69 views

LibGDX - Rotating sprites and still keep the positioning between them

I've been struggling with a problem regarding rotations and relative positions between sprites (in this case, the sprites are just lines) - a bit off-topic, but should i be using the ShapeRenderer ...
0
votes
1answer
41 views

Import JXInput by StrikerX3 Into Eclipse

I'll be honest, I'm stumped, I've been trying all night, googling away, made multiple attempts and failed every time. The library in question that I'm trying to add to my project is: ...
0
votes
0answers
10 views

animation of an Actor in libgdx crashes on iphone

I am using a class found here on stackover for the animation of the actors , but I crash on the physical device class AnimatedImage.java: public class AnimatedImage extends Image { protected ...
3
votes
1answer
66 views

Fixing the size?

I have been stuck on an issue for 6 hours now, and would really appreciate your advice. Currently, my app isn't compatible with all screen sizes. When testing on a small size, my textview overlaps ...
2
votes
1answer
54 views

Referencing individual cells of a tilemap and changing texture

I have a tilemap and am trying to proceduraly generate islands on it by changing the texture of the tiles and marking it as land ( I want to do this without texture atlas for now). How do you change ...
0
votes
0answers
37 views

SpriteBatch draw does not work on iOS - LibGdx

I have a small problem , in practice if I batch.draw ( ... ) ; It does not work on iOS with robovm . my code.: on the crete() method: texture = new Texture(Gdx.files.internal("background.jpg")); ...
1
vote
0answers
19 views

Does Overlap2d have frustum culling

I'am wondering if Overlap2d has a own frustum culling or do I have to implement my own?
0
votes
0answers
22 views

Libgdx HexagonalTiledMapRenderer

How does the hexagonal tiled map renderer work in libgdx I'm trying to render a hexagonal tiled map and I can't quite get it to display correctly I've used the orthogonal tiled map renderer before and ...
0
votes
0answers
67 views

Does the sound need to be fixed?

Are there special requirements for audio for different devices? I have been stuck on this for around two days now, and would really appreciate all the help I can get. I have some audio in my code. ...
3
votes
1answer
290 views

How do I deal with collision resolution causing another collision?

I'm making a simple 2D, top-view simulation of an evacuation, sprites running around, looking for exits, going at it, all that good stuff. I have no control over them when the simulation is running, ...
1
vote
1answer
97 views

LibGDX - Level management on a level-based game

I'm new to LibGDX and android development in general and am trying to do a puzzle game. Being a level-based game, i'm trying to make it so in every level a certain number of blocks (just rectangular ...
8
votes
0answers
199 views

Load ads in splash screen?

I have some ads that take a very long time to load. I was wondering it it is possible to have them load while the use was in the splash screen. I have looked at this answer: ...
1
vote
1answer
48 views

How do you rotate all the objects around the camera?

If I'm correct, the way that you can "look around" in an environment is that you rotate all the objects around the camera. This is the code that I've created using JavaFX 3D. So what's the algorithm? ...
4
votes
0answers
37 views

Only working on certain devices? [closed]

I am designing my first android game, and this is my first question on gamedev.stackexchange. My MediaPlayer is null on my genymotion emulator, but is working fine on my actual android device. I ...
0
votes
0answers
31 views

Alternative to Loading Models into JavaFX

Here's my problem. I'm making a copyrighted game that is to be released by using the JavaFX 3D framework, and I want to import 3D models . I have heard of software indicated at the link here: ...
1
vote
1answer
64 views

Scoping my first project [closed]

So I'm writing my first game which is a RTS and one of my main ideas for it is multiplayer deception however I'm finding it hard to control the scope of my project. Yes im thinking pretty small but ...
4
votes
3answers
217 views

Writing my own gravity

I am writing a little game engine in LWJGL. I want to have a gravity, but I don't know correct equations. Let's assume that I've got a 3D vector marking gravity force in each axis(e.g. Vector3f(0.0, ...
1
vote
1answer
37 views

When handling key input, I'm getting a negative timeout value in my thread. What's going on?

So I'm programming a game using Swing and AWT and I'm getting a weird error. As I check for input in my MenuState, which is just my Menu screen, it is telling me that the timeout value in my game ...
3
votes
0answers
30 views

Java image in JFrame rendered weirdly

I'm not sure if this is intended or not, if it is, I'd like to know a way of preventing this: I've got this image (which is for testing purposes, the actual one has a texture, but I'm not using it ...
3
votes
1answer
80 views

How to make “Shaky mouse cursor” Before shoot the target Like in a Dart Game?

I develop a shooting game. To make it harder I want to make the reticle shaky/move randomly. I use Robot class to move random as suggest here. But I modified it by adding an infinity loop and by ...
1
vote
0answers
19 views

Android Game Development. Type Usage for Entity Positions

I've recently started developing on Android and have made some basic apps. I now wish to start development on a game project. I have intermediate skill in Java and will be developing with that ...
0
votes
1answer
36 views

Strange Rotation in LWJGL

What I am trying to do is to create a Rubik's Cube game using LWJGL in Java. I have a lot of it done already, the only problem is the rotating. It just isn't working. I've tried multiple ways of ...
1
vote
0answers
60 views

Overlap2d + LibGdx load large map

I've been wondering if it's possible to load a large map made with Overlap2d before I get started with my project. A large map for me is something equivalent to a map from recent open-world RPGs like ...
1
vote
0answers
26 views

From Core Java Graphic Dev To JOGL [closed]

I've been a java developer for 3 years, and I got one opportunity to explore JOGL. Is it a good idea to move into JOGL from being a core java developer ?
2
votes
1answer
83 views

Slick2d fullscreen with black bars

NOTE: I am moving this question here from Stack Overflow because I feel it belongs better on this forum. I am deleting the original question from Stack Overflow. I'm working on a game in Slick2D and ...
1
vote
0answers
38 views

Libgdx box2d - what is the best approach to spawn an actor on a stage dynamically?

I'm currently building a 2d sprite infinite runner game, but everytime I spawn new enemy(actor) and platform, I noticed that there's a delay on it. Any idea of what would cause this behavior? I'm ...
1
vote
0answers
16 views

LibGDX: Box2d hovering, rotating body

Hello I am working on a hovering triangle (equilateral triangle). The triangle should allways rotate at a constant speed and hover over the ground. The problem is if I setAngularVelocity it does rise ...
1
vote
2answers
57 views

opengl z index changing does not zoom in

I am making a simple opengl application where I have a cube and I want to move forward to it with the glTranslate3d function, where I change the z index. One would expect the object to get bigger ...
1
vote
1answer
95 views

How can I make terrain texturing look detailed both close-up and far away?

I attempting to make my game have very detailed textures, and in general look pretty. However, I'm having some issues with that. Let's take a look at a rock texture close up: Picture. As you can ...
4
votes
1answer
71 views

How to spawn Chunks in Libgdx?

I'm currently working on a 2D platforming game with an infinite map. I did my research and I discovered that I can use chunks. Based on my understanding chunks is about spawning terrain at the right ...
4
votes
1answer
74 views

Finding it difficult getting to grips with LibGDX [closed]

So I have spent about a week now learning libGDX and have made very little progress. I started small and wanted to make a strategy game where there is a tiled map of squares and you control a ship, ...
2
votes
1answer
28 views

Slick2D How to add a method from a diffrent class to a method

I am trying to get keyboard input in a separate class so everything doesn't look as messy. I get the following error message Exception in thread "main" java.lang.NullPointerException at ...
2
votes
1answer
61 views

How to draw a circle that is around an object and becomes smaller if the player enters it

I'm making a game in Java w/ slick and lwjgl and right now I want to do the following: draw a circle, that is drawn around an object with a radius of e.g. 75. I want the object to be IN THE MIDDLE of ...
2
votes
0answers
117 views

How to calculate delta-time on Android? [closed]

How do I calculate the time between frames on Android? I'm using this for the thread: public class GameThread extends Thread { private int FPS = 30; private double averageFPS; private ...
3
votes
1answer
56 views

Is it possible to use OpenCL in libgdx?

Been looking for a way to implement some OpenCL stuff in my libgdx project. It's possible via LWJGL which libgdx is based on, but it's only for the Desktop environment. Would like to have it cross ...
2
votes
1answer
27 views

Java Slick2D how to draw text with a centered alingment

I've made a button class that can be drawn and clicked on. How can I write the text of that button (using the slick drawing API, g.drawString()) with a Centered alingment (so that the text is exactly ...
1
vote
1answer
46 views

Question of tilesheet efficiency

For a 2d side scrolling game made in Java, should I make a sprite sheet for my character walking left and for walking right, or should I just do the one, and flip it when it loads? Also, the way ...
0
votes
0answers
26 views

Using BitMapText in response to Collision in jMonkeyEngine

I am starting to use the jMonkeyEngine and I messing with the collision and trying to use BitMapText. I have my scene, terrain, models, bullets, and objects but is there a way to use BitmapText that ...
2
votes
1answer
32 views

Libgdx : surround sound

in libgdx there is a lot of audio classes but i haven't seem to of found anything relating to balancing sound in one speaker and or the other to get surround sound say you check if an object is more ...
1
vote
1answer
93 views

Acceleration problems

Im trying to make a car game, but i cannot get the acceleration code right. With this code: if(gas){ speed += 3; }else if(break_ && !(speed < 6)){ speed -= 3; ...
1
vote
0answers
48 views

Which game engine to use for Android TV? [closed]

I am trying to tinker a bit on Android TV game development and I am trying to figure out which would be the best suited 2D/3D game engine for this purpose or, alternatively, which are the main aspects ...
2
votes
0answers
120 views

How do i add a rain effect to a top down design game in Java, using no external libraries?

I'm creating a top-down game for my A-level/college computer science project, and I'm trying to implement rain. The game needs to be usable on any platform, so the use of external libraries is out of ...
2
votes
0answers
93 views

What are the newest alternative to all-in-one game engines? [closed]

I have been seaching a while for recent alternative to engines like unity or unreal, however, I haven't found one actively maintained that meet my needs. For instance, I tried irrlicht with maps ...
2
votes
1answer
49 views

Java - Loading background music into memory

I am currently developing a game with Java, with a soundtrack consisting of ten tracks in .ogg format, 1-2 MB in size each. To be able to switch between these tracks quickly and easily in the game, ...
1
vote
1answer
34 views

Getting an object to shoot directly towards click libgdx java

I am trying to get my player to shoot a spell and it travels to where ever the player clicked. I can easily accomplish this by doing the following. if(position.x >= destination.x - 1 ...
2
votes
1answer
42 views

Changing the direction of a particle in libgdx java

I have a particle the explodes upwards. This would work the way I want if the particle always hit the ground. However I want the particle to explode at a -90 degree angle if it hits a wall from the ...
2
votes
3answers
138 views

How do you get the best rendering performance in a 2D Java Game?

I have seen a lot of tutorials, and they develop games with 2 different ways: The first one is using a virtual image (BufferedImage) and filling it's pixels. And displaying virtual picture. private ...
2
votes
1answer
41 views

How to check/read multiple elements of the same arrayList at the same time in Java?

Im making an rpg game and right now I'm working on crafting. I've made a crafting slot class, and an arrayList of that class. I've got 10 of those slots in total, 9 placed in a 3x3 'order' and 1 below ...
1
vote
1answer
66 views

Java heart based health mechanic

so I've made a basic game in java w/ LWJGL 2 and Slick. Right now Im working on the hud and health system. I'm kindof trying to get a minecraft like health system, 15 hearts for health,but I want the ...
1
vote
0answers
41 views

Is it good idea to update player stats like this? [closed]

I have simple Inventory class going on, that is in charge of managing player Storage and equipped items, but currently I have single method that operates on player himself called updatePlayer and I am ...