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

3
votes
0answers
596 views

How to make the background of an OpenGL object transparent?

It sounds so simple but i didn't get it to work. The Background of my FrameLayout where i add the GLSurfaceView in is colored blue but there is only black. So here is my method to initiate the ...
3
votes
0answers
891 views

Collision Detection on floor tiles Isometric game

I am having a very hard to time figuring out a bug in my code. It should have taken me 20 minutes but instead I've been working on it for over 12 hours. I am writing a isometric tile based game where ...
2
votes
0answers
62 views

LibGDX controllers: how to fix crashes in JRuby?

I'm using JRuby with LibGDX and it's been going quite swimmingly, save for a crash I experience every time I try to use the controllers extension. Here's a basic rundown: I've required all the ...
2
votes
0answers
101 views

JBox2D Polygon Collisions Acting Strange

I have been playing around with JBox2D and Slick2D and made a little demo with a ground object, a box object, and two different polygons. The problem I am facing is that the collision-detection for ...
2
votes
0answers
598 views

Libgdx ParallaxScrolling and TiledMaps

I implemented ParallaxScrolling for my SideScroller project, everything is working but the tiled map (the most important part!). I've been trying out everything but it doesn't work (see the code ...
2
votes
0answers
116 views

Images out of “sync”

I've been creating a game in Java as a bit of a fun side project over the last few months and I've come across a really peculiar problem, take a look at this image: The game is made up of various ...
2
votes
0answers
406 views

Rotation of viewplatform in Java3D

I have just started with Java3D programming. I thought I had built up some basic intuition about how the scene graph works, but something that should work, does not work. I made a simple program for ...
2
votes
0answers
1k views

AndEngine Making Chase Camera Follow Player

I am playing around with the AndEngine Race Game example. I am trying to make the camera follow the car as the player moves around. The Tile Map is larger than the player's screen but the camera ...
1
vote
0answers
54 views

3D Camera Y-Axis wrong angle

I am trying to build a camera class, though I am running into a problem. When I move the camera above/below, and try to move towards the ground, I am moved off in what seems to be about 45 degrees in ...
1
vote
0answers
81 views

Android and OpenGL, single thread vs double thread

I'm trying to optimize my Android OpenGL ES 2.0 application, and I find myself being CPU bound. After googling, I've found this, which suggest to use a thread for updating objects, and a thread for ...
1
vote
0answers
52 views

Cannot distinguish depth in an isometric cube

I am having a problem with distinguishing different depths in my new 'game.' It is a game similar to Minecraft, only it is rendering in isometric format. The problem is, I cannot think of a way to ...
1
vote
0answers
142 views

How do I implement a “sliding out of / into” effect on a settings menu similar to that in Angry Birds?

I'm trying to implement a settings menu component similar to that in Angry Birds - a button control that makes an options menu slide out of it and back into it when clicked on. I use scene2d.ui to ...
1
vote
0answers
59 views

Need to join 2 bodies via weld joint but not on center of mass

I have successfully join 2 bodies via weld joint , but my problem is I want to join corners of bodies not on centre of mass. Is there any way to achieve this? Above image consist 3 polygon body that ...
1
vote
0answers
105 views

Drawing visible tiles - side scrolling

Currently I'm calling drawMap every time repaint is called. This is the code I've written for my drawMap method so far. public void drawMap(Graphics2D g2d) { int minOffsetX = 0, minOffsetY = 0; ...
1
vote
0answers
58 views

Slick2d font rendering makes all other drawings vanish

I'm converting a java game to lwjgl and slick-utils. I've followed the slick2d examples for font loading/rendering but I found that the font shows as a solid box of color unless I add the following ...
1
vote
0answers
154 views

Exporting from eclipse with lwjgl using jarsplice

I am in the process of developing a 2D tilebased rpg with eclipse, lwjgl, and slick util. For some reason eclipse seems to be lagging heavily which doesnt make sense as all i have rendering is a ...
1
vote
0answers
164 views

Why do my LWJGL fonts have dots and lines around them?

When we render fonts there are weird dots and lines around the text. I have no idea why this would happen. Here is an image of what it looks like: Our font class looks like this: package ...
1
vote
0answers
221 views

OpenGL: Attempt to allocate a texture too big for the current hardware

I'm getting the following error: java.io.IOException: Attempt to allocate a texture to big for the current hardware at ...
1
vote
0answers
430 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. ...
1
vote
0answers
105 views

Aiming with a crosshair with a lot of polygons/triangles

I'm working on a 3d kindof game where I'll eventually be able to modify the shapes present in the environment by pulling their faces with a crosshair. The thing is that I don't know how to achieve ...
1
vote
0answers
86 views

How to put OpenGL in a state for drawing blended, colored, nontextured polys?

Using OpenGL1.1 (sadly) I'm trying to draw a cube, which is colored and alpha blended. It is instead showing up as opaque black. Even without including alpha in the color it still shows up as opaque ...
1
vote
0answers
58 views

Creating transparent image with localGraphicsConfig not always working

I'm trying to use GraphicsConfiguration.createCompatibleImage to create transparent images. This creates an empty image which I'm filling with a mosaic pattern later on in the code. This seems to ...
1
vote
0answers
472 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 ...
1
vote
0answers
1k views

TileMapRenderer in libGDX not drawing anything

So I followed the tutorial on the libGDX wiki to draw Tiled maps but it doesn't seem to render anything. Here's how I setup my OrthographicCamera and load the map: camera = new ...
1
vote
0answers
257 views

How do you program the right analog stick of a controller in JInput?

I have the Left Analog Stick programmed and accepting input (moving a character around). (getCompassDir() returns the values of the cardinal directions and NONE means the stick isn't touched): // ...
1
vote
0answers
198 views

When attaching AI to a vehicle should I define all steps or try Line of Sight?

This problem is related to an intersection simulation I am building for university. I will try to make it as general as possible. I am trying to assign AI to a vehicle using the JMonkeyEngine ...
0
votes
0answers
37 views

Simple Libgdx bullet example

I'm looking for a SIMPLE example of the use of the bullet physics engine in libgdx. Before you point me at the wiki, I have read that, but that mostly describes installation, and just a "raw" ...
0
votes
0answers
12 views

Incorrect click event when resize on libGdx

I want to use scene2D, in libGDX, to detect click on object. I have this simple Game sample : Stage stage; @Override public void create() { this.stage = new Stage(1280, 720, true); ...
0
votes
0answers
37 views

Playing repeated sound in Java

I'm trying to play sounds in a Java game with the following code: AudioStream audioStream = new AudioStream(stream); AudioPlayer.player.start(audioStream); The stream variable is just an ...
0
votes
0answers
32 views

Using multiple uniform blocks in OpenGL

I'm using OpenGL with JOGL and want to use two unfirorm blocks in my vertex and pixel shaders. The following GLSL-Code shows the definitions:- uniform perObject { Material uMaterial; mat4 ...
0
votes
0answers
14 views

GWT problem with Box2D WheelJoint

I am using the below libgdx java code for a wheel joint and rear axle using Box2D. This works fine for android, Desktop, but when I attempt to run through GWT I get the following error. at ...
0
votes
0answers
29 views

Rendering bug in java

I'm using a simple rendering method in java to render tiles. Everything looks fine, but I notice that some rows grow 1 pixel when I move, and dhen shrink back, but I have no idea why. Infos: I'm ...
0
votes
0answers
10 views

Slick util TiledMap stops all other drawing

Im trying to add tile maps to my game. Before I added the tile map, I had 3 quads being drawn for testing purposes, but after adding the tile map, the quads are no longer drawn. private static void ...
0
votes
0answers
11 views

Java2D Swing rendering off center on ONLY OSX

I'm having an odd issue with my animation that is happening only on OSX, and not on windows. On my windows computer, the animation occurs full screen in a JFrame, as it is supposed to - however on my ...
0
votes
0answers
20 views

How do I add an image inside a rectangle or a circle in JavaFX?

Suppose we have a rectangle called r Rectangle r = new Rectangle(40, 20); and an image called image Image image = new Image("...src for image"); How do I fit the image inside the rectangle? ...
0
votes
0answers
21 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
0answers
70 views

Moving objects smoothly, bad perfomance

I just finished developing my mini-game on Android and I got some questions about perfomance and generally "how to": If I have 25+ objects on the creeen (just a polygon with 7-8 angles) its starts to ...
0
votes
0answers
31 views

2D Collision in JavaFX - Bad accuracy with .intersects()

I have several Shape objects - Circle, Rectangle and Polygon. I use the built-in .intersects(Bounds1, Bounds2) method to detect collision but it's quite inaccurate. Circle c1 = new Circle(20); ...
0
votes
0answers
57 views

LibGDX vs Flash/Starling

I currently use Flash/Starling to develop cross platorm games. I love it because it has awesome features like tweens, texture atlases, DragonBones, touch gestures, ad integration, in app purchase ...
0
votes
0answers
24 views

Box2dLights rendering in bigger scale

So basically my box2dLights are rendering in wreid places. The circle in center is my player and as you can see lamp which should be aligned to player is in the right-top corner. my code: package ...
0
votes
0answers
126 views

How do I handle collision involving many characters?

My collision checking works fine. The problem is what to do after two zombies collide so they still walk towards the player but don't go through each other. My current method works fine for two or ...
0
votes
0answers
33 views

Why isn't my texture changing after calling display list?

I can't bind another texture after calling glCallList. It does nothing. However if I change texture inside the list, it works.
0
votes
0answers
29 views

libgdx get rotated sprite coords points

I would like to get the position of each edge of a sprite when he has been rotated. I have no idea how to do it, I made a image to explain it. I would like to get the X and Y position of each Red ...
0
votes
0answers
53 views

Finding the correct transformation in vertex shader for easy sprite drawing

Before we begin the question: Here are the necessary meta information: I want to use JOGL / OpenGL to create a library that is only, and I repeat only, able to draw and manipulate 2D sprites on a 2D ...
0
votes
0answers
46 views

how to do picking in 2d lwjgl

I searched the whole internet, but I couldn't find something useful. How to do picking (like ray picking) in lwjgl in orthographic mode (2d)? I think this is less confusing than picking in 3d, but I ...
0
votes
0answers
29 views

How can I draw a part of a texture in slick2d?

I know the method for drawing a region of a texture in slick2d: image.draw(x, y, srcX, srcY, srcX2, srcY2); But I have no idea how the texture coordinates work. To draw a region of x:16, y:16, ...
0
votes
0answers
26 views

Java JOGL NEWT Window without FPSAnimator

how I am new to OpenGL and especally with JOGL. I currently try to learn JOGL. I dont like to create a special thread that runs the display method of my window, so I called it manually. public static ...
0
votes
0answers
81 views

Polygon Collision Response

I'm working on a game engine that has a built in custom physics engine (I know it's a waste of time, but I have years to make this, so why not make it good?). Currently, with any number of polygons, ...
0
votes
0answers
48 views

LWJGL Rotating is moving

I am trying to rotate my QUAD even just a little bit. I have read pages like http://www.java-gaming.org/topics/lwjgl-tutorial-series-moving-and-rotating-triangle/30679/view.html In my render() ...
0
votes
0answers
21 views

Box2D Joints Disconnect

I'm trying to make a soft body physics system using rigid bodies in a circle. I'm having a problem where my joints only connect to one of the bodies, and seems to disconnect from the others. I think ...