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

0
votes
0answers
2 views

Rectangle Flash fix and draw string

Now i have a code wich is work :) But now i have 2 bug and i dont know how to fix it.I drawing a rectangle (thats work) but its flashing and i dont know why. The second bug is i did a score int and ...
0
votes
1answer
46 views

How do I fix a delay between the first and second KeyEvent

I recently got really interested in making my own little game. As I have no real game development background I'm still figuring stuff out, but I encountered a little problem. While working on the ...
0
votes
0answers
11 views

LibGDX - FPS drops

I've been trying to record some gameplay footage of the game I'm currently working on, using the Android SDK and ADB to do it. Whilst the game runs at constant 60 fps in my medium-end phone, as soon ...
0
votes
0answers
9 views

Libgdx Music is not working again

I am starting background music when the user goes to the PlayScreen and when the kid in the game dies, the background music stops and starts game over music and move to game over screen, then the user ...
1
vote
1answer
69 views

Java Distance between two Vector positions never 0

I have a Player moving, but when the player reaching the destination it should stop. But problem is that distance never return 0. It starts printing this: 0.9672514210000003 End by this and then ...
0
votes
1answer
39 views

What are the core concepts needed for a basic game? [on hold]

I'm planning on using JavaFX to develop my first game, and I just wanted to know what are the core concepts I need to understand first? From my research so far it seems to be animation and collision ...
1
vote
0answers
11 views

How do I resolve the inability to get an input stream from URL?

I am unsure if anyone has ever had problems with this, but I am having difficulty trying to get the URL to work properly however, this is what the logs says javax.imageio.IIOException: Can't get ...
2
votes
0answers
52 views

Why aren't my pieces rotating on my chess board in Java?

I am developing chess game in Java using the Netbeans IDE. Instead of rotating the whole board at each move, I thought of changing position of the pieces themselves, while the board remains same. All ...
0
votes
2answers
53 views

LibGDX - Collision detection between all bullets and all enemies

I'm trying to make a collision detection system between the player's bullets and all the enemies on screen. So far I had something like this: for (Bullet bullet : hero.getPistols().getAllShotBullets(...
0
votes
1answer
21 views

Receiving a “cannot find symbol” error [on hold]

In my Java class, we're creating a connect 4 game. For now, we're just setting up the GUI. I am receiving the error on lines 13 and 14 " private ArrayListplayer; private Connect4Ui ...
0
votes
0answers
13 views

Libgdx Ending level is not working properly

In my game the kid is collecting fruits but if he hits the rock 3 times or time is up before collecting the required points, the kid will jump to the half of the screen then fall down and start fail ...
0
votes
0answers
11 views

Libgdx Scene2D Table background not whowing up

I am using Libgdx's Scene2D API to build by UI and everything has been working as expected until now. I created a Skin and a TextureAtlas and linked them as so: Skin skin = new Skin(); TextureAtlas ...
1
vote
2answers
44 views

Textures are not drawn separatley

I am trying to draw different textures of balloons and I want them to appear in different times about half second between each one, and move in the world. first balloons are rendered but after about ...
0
votes
0answers
22 views

java - Instance culling using geometry shaders

I'm developing my own game and for that I want to implement frustum culling, to archive an performance optimization. I found a description on the internet (enter link description here) and this one ...
1
vote
1answer
37 views

How to “port” Java2D code to LWJGL

I've been following some game tutorials on youtube and developed a custom engine using Java (Graphics2D, BufferStrategy and such). I have a class "Surface", which represents any 2D object (image, ...
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, ...
3
votes
3answers
398 views

Fastest 3D bounding box algorithm

I am at the point in my game where I need to add a collision system. I tried jBullet, and while it did work, it wasn't what I was looking for. I just want a simple way to test if two oriented bounding ...
1
vote
2answers
39 views

Should I have one asset manager and unload and load with different gamestates? Or should I have one for each gamestate?

I am working on a LibGDX game and I would like to find out the best way to manage assets. Should I have one AssetManager that is passed through to my GameState init() method to load from each level, ...
1
vote
2answers
34 views

Libgdx Back button exit the app

when I press back button on android, it exits the game although I ask it to go to other screen instead. It goes to the other screen for one or two seconds then it exits.: if((Gdx.input.isKeyPressed(...
2
votes
1answer
25 views

Libgdx Image doesn't fit the Screen

I am Trying to show Image as background, but it doesn't fit to the screen. When I use this class as the start screen it fit the screen properly but when I call this class after winning the level, the ...
1
vote
1answer
339 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 ...
0
votes
1answer
94 views

Libgdx Fine Tune Megaman Movement

With help from my last question, I was able to fix the issue of having a stuttering effect if you keep hitting jump, while jumping. I believe I have managed to match moving on the X axis and the ...
0
votes
1answer
71 views

Positioning partials of character sprite animations

I'm not entirely sure how to best explain what I'm doing. Maybe I'm going about this completely the wrong way. If any of you find that that is in fact the case, I would appreciate it if you told me ...
2
votes
2answers
772 views

How to use the zoom gesture in libgdx?

I found the example code for the GestureListener class, but I don't understand the zoom method: private float initialScale = 1; public boolean zoom (float originalDistance, float currentDistance) { ...
0
votes
2answers
71 views

Java Slick2d image depth/layering

Im making a topdown 2d game, and I've made a decent entity system so far. But I want to do the following with it: I want to have drawing depth, so if a , for instance, tree is above another tree then ...
2
votes
1answer
1k 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
15 views

Two Viewpagers - swipe from one to another cause stuck

I have two Viewpagers, one is controlling whole layouts (pages), and second holds some items. First one is named viewPager1 in this image: Works good, but not perfect; As you can see, there's ...
0
votes
1answer
48 views

LibGDX: how to implement 2 cameras in a unique stage

I am quite new to LibGDX. I am trying to make a game, where the character is an Actor, and it's controlled by a Touchpad(included in the main Stage as an Actor too). My problem is that I am trying to ...
2
votes
1answer
119 views

Minecraft modding: onLanded and item type/positioning?

My question is about programming Minecraft mods. So i added a block to my Mod. Now I want, that when you drop a sugar on it, that it waits some time and then, if the sugar is still there, it will ...
0
votes
0answers
33 views

I want to make a pie countdown timer in LibGDX

How would I go about making one of these in LibGDX? The number in the middle isn't necessary. And to make it clear, I'm not looking for an implementation or a "hand out" of source code. Just point ...
0
votes
1answer
471 views

Why is my screen black?

I'm developing an android game, and my screen is not displaying what I want it to. I've read various tutorials but they are either outdated or hard to follow. I have followed this tutorial and most of ...
3
votes
1answer
450 views

How to draw a polygon with picture in libgdx?

I'm working around a simple rectangle game, It just split the rectangle in to a lot of polygon debris. I use Pixmap and Texture to draw the edges of each polygon. ... for (GraphEdge e: _edges) { ...
1
vote
1answer
49 views

How to dispose in Newest Java/LibGDX ApplicationListener?

Am I new? yes What I'm wondering: How do you dispose of textures / spritebatches and the things you normally need to dispose of now? Why I'm asking: Because theirs no automatic dispose() function ...
0
votes
2answers
38 views

Black lines on sprites

I am having the issue as seen below while using a textureAtlas with libgdx. I haven't found anyone else with the issue so I decided to ask here. Here is an image of the textures in the game screen: ...
0
votes
1answer
33 views

Libgdx if statement is not working well

I am trying to make the player die when it hits the rock or the time is up and the score is not reached, in this code at the first if statement it works when Rockhit is true, the player jump and ...
0
votes
0answers
18 views

(LibGDX) Any Good Librarys or some thing for saving and reading data from a file [closed]

I'm going to add a add a library or a system that will save or read data from a file, but i couldn't find any that will work with my project. -I want it to save it in a human readable language example:...
2
votes
2answers
159 views

Android libGDX FreeTypeFontGenerator exception

I am working on a libGDX project for Android. Since I added the following code, running the game on my Android phone produces an exception: final FreeTypeFontGenerator generator = new ...
1
vote
0answers
49 views

Implement gpu based dynamic geometry lod with openGL

I'm currently working on my own game and for that I wanted to implement LOD, to boost the performance. I found a very nice tutorial on the internet: http://rastergrid.com/blog/2010/10/gpu-based-...
0
votes
1answer
59 views

How to apply Buoyant force to a Box2d body?

I have been following a formula to calculate the buoyant force needed to apply to a dynamic body to be able to simulate water. Fb = ρgV Fb - is the buoyant force ρ - density of the liquid g - ...
0
votes
1answer
377 views

problem adding bumpmap to textured gluSphere in JOGL

I currently have one texture on a gluSphere that represents the Earth being displayed perfectly, but having trouble figuring out how to implement a bumpmap as well. The bumpmap resides in "res/planet/...
1
vote
1answer
115 views

LibGDX - How to export a texture as a .png onto, say, the desktop

I'm making a game in which I need to export a texture which the user has edited as a .png into a specified location. I'd like it if I could have the default saving window thing (like on other apps ...
1
vote
2answers
147 views

Getting the tile over wich the mouse cursor is

Im making a tilebased game, I have the rendering, the main engine, everything setup nicely (btw Im using LWJGL and Slick). Now this is more of a math question. How do I get the tile the mouse is on, ...
0
votes
0answers
24 views

Java - Issue colliding with more than one object

Ok, I am working on a simple 2D sidescroller game and having issues with the player (or any moving entity) colliding with another entity. My current method, (a box on north, south, east, and west to ...
2
votes
1answer
101 views

In JBox2d when dragging a Body, why is the direction is flipped vertically?

Why is it when I drag a JBox2d Body with the mouse, the vertical component is flipped? e.g. If I drag down-right, the Body moves up-right. Is this expected behaviour, a bug in JBox2D, a Mac ...
1
vote
0answers
28 views

Different Box2D bodies act differently and unexpectedly with same mass

I have a box2d body which is simply a rectangle (the spaceship). This ship flies around, affected by the gravity of planets (static circle bodies) just fine. I have tried changing the ship fixture ...
0
votes
1answer
150 views

Moving a Polygon based on Camera position

I am in the process of implementing TMX Maps (made in Tiled) for my game. In Tiled, I can create polygons, which leaves a tag, containing the points. Loading in these points to a Polygon (java.awt....
1
vote
2answers
411 views

LWJGL: Camera distance from image plane?

Let me paste some code before I ask the question... public static void createWindow(int[] args) { try { Display.setFullscreen(false); DisplayMode d[] = Display....
1
vote
1answer
71 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 loop....
1
vote
1answer
59 views

Problems managing collision filtering

I have my character fixture and body(is a tank), so when I press the screen it throws a rocket(which also has a body and a fixture) that the player can controlll touching the screen. My game also has ...