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
2answers
138 views

Texturing a VBO cube (JOGL)

I've been having trouble texturing a cube using vertex buffer objects. EDIT: I updated/replaced my shaders to fit the right version. The program compiles and links, but it shuts down java in ...
1
vote
1answer
4k views

LibGDX Box2D Body and Sprite AND DebugRenderer out of sync

I am having a couple issues with Box2D bodies. I have a GameObject holding a Sprite and Body. I use a ShapeRenderer to draw an outline of the Body's and Sprite's bounding boxes. I also added a ...
1
vote
1answer
100 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
1answer
46 views

Does LibGDX abstract OpenGL ES away or can I still use my OpenGL ES knowledge?

I've been learning OpenGL ES, and am now turning my attention to using LibGDX. My main concern with LibGDX is, if needed, will I be able to apply my OpenGL ES knowledge to something if needed and ...
1
vote
1answer
75 views

Tiles touching all of same color check

I'm currently having a problem that has stopped my productivity for quite a while. I need to check if all tiles of a color is touching each other for each color like this: I have all my code for ...
1
vote
1answer
89 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 ...
0
votes
0answers
18 views

Drawing jbox2d shapes in slick2d

How would be the best way to go about drawing polygons in slick after forces where applied to them via jbox2d? There seems to be no way to get the vertices of a body defined in jbox2d...
0
votes
1answer
1k views

Android Bitmap: Collision Detecting

I am writing an Android game right now and I would need some help in the collision of the Pawns on screen. I figured I could run a for loop on the Player class with all Pawn objects on the screen ...
0
votes
1answer
38 views

Get stick analogue XY position using Jinput in lwjgl

I want to capture the movement of the analogue stick of the gamePad. is there any equivalent function to this? public void mouseMoved(MouseEvent mouseEvent) { mouseEvent.getX(); //return the X ...
1
vote
1answer
72 views

Restarting a libGDX game to apply changes to resolution

How can I restart a LibGDX game to apply certain changes to the game such as changes to the resolution (going from 1920X1080 to 1280X720), or changing full screen. Granted the resize(int width, int ...
-1
votes
1answer
52 views

Java Game: Fullscreen images

Hi I am making a football stratedgy game and I have it the game working. I was playing prison architect and minecraft in fullscreen and noticed there was no windows it was covering the whole screen. ...
5
votes
2answers
530 views

Is it possible to implement Steamworks functionality in a Java game? How?

I have a basic game that I want to eventually turn into something better. The game is all Java as of right now, but I want to implement the Steamworks SDK into my game (so it can have achievements, ...
0
votes
0answers
29 views

libgdx ScissorStack problem

Im making a user interface using libgdx I created a Window class & a Textfield class, that both use clipping. I use the ScissorStack class of libgdx for clipping. The Textfield is drawn inside ...
3
votes
1answer
78 views

How do you create a game overlay that makes the underlying graphics inactive?

I've created a simple game, and I drew a large rectangle in photoshop with faded edges that I want to use to overlay the game until the user presses "Begin" (on the overlay). The problem I'm currently ...
0
votes
0answers
44 views

Collision between player and heightmap

Im programming a small project, an opengl height map. It is build of triangles, which points are fit to the right y position (read out of an image). The player is represanted by a cuboid. (p1, p2, ...
0
votes
0answers
11 views

InvocationTargetException caused by IllegalArgumentException due to trying to create a new OpenAL instance

So, after creating this class, (in this LINK) , I ran into a new problem, I recieved an InvocationTargetException, which is generally caused when a method is invoked and an exception is created when ...
0
votes
0answers
12 views

Using Graphics from my Frame's paint() gives cutting effect every call to repaint()

Every frame the run() method of my thread calls the repaint() of the frame subclass, in this frame subclass I override the paint(Graphics) and since I want to have different screens from my game I ...
0
votes
0answers
38 views

Is there any benefit to using sprite sheets in Java with awt?

I am aware that this question addresses the issue for flash and this question addresses the issue vaguely for miscellaneous rendering engines like OpenGL. The way the latter asserts the superiority of ...
2
votes
1answer
54 views

Centering a textbutton in a table libGDX

I have a few Tables spread across a Stage, now I have a problem. In one table, all the TextButtons are centered, while in a different one they aren't, like this: Table 1 Table 2 XXXtextXXX ...
1
vote
1answer
53 views

Libgdx - Sprites disappearing [closed]

I'm facing a little problem and I have no idea to bypass it. I've made a dungeon generator and I'm able to spawn randomly mobs, the problem is that when they are not moving the game is fine, but at ...
1
vote
1answer
59 views

Libgdx Box2d createfixture crashes vm intermittently

I have a hard to debug problem. I have a Box2D game which creates a wheeled vehicle. I want the vehicle body to reflect when it goes from moving left to moving right. to do this i set a flag in a ...
0
votes
2answers
146 views

Driver inversion

I have a GUI game, which is driven by user every time it clicks the mouse. Every time user clicks a square on a board, the board state is updated (we re-compute the score, the player to make next move ...
1
vote
1answer
106 views

Dialog Title Does Not Fit

I successfully added my own font to the default .json file and it displays, however I get some weird sizing issues. Specifically when I try to create a Dialog. This is what it looks like: Ignore the ...
0
votes
0answers
47 views

Have button style not change when down

I'd like the button style to only change when it is checked and not change when it is pressed down, and/or have only the font color change. I'm using the built in Skin function with a .json file, ...
0
votes
1answer
60 views

background move to the right

I'm developing an android app and want to make move the background to the right. The problem that I have is if it moves it does not repeat the background. I appreciate every suggestion. Thanks. The ...
2
votes
0answers
98 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 ...
0
votes
0answers
36 views

Frame Buffer couldn't be constructed: incomplete attachment error on nexus 7

So I am running into an issue where I cannot load my game onto the nexus 7 because of the error stated previously. I read online that this is because the device can't use the Format class or something ...
0
votes
1answer
47 views

Nullpointerexception when loading resources in openGL ES 2.0 Android project

Overview My splash screen starts by display a 'loading' dialogue and then kicks off an asyncTask (The loading dialogue is derived from the standard Android View class) Within the doInBackground ...
0
votes
1answer
295 views

How do I handle collision response between many different types of game objects?

I am looking for a way to avoid the dreaded switch or if/else scenarios between numerous game object types when a collision takes place in a game. For example: You have a list of game objects which ...
0
votes
1answer
83 views

Re-using one texture for multiple OpenGL Quads

I've been looking over my code and I'm just wondering, when I set a texture for say, 20 quads that need to use the same texture, it seems as though I'm creating a new texture each time...... surely ...
0
votes
0answers
30 views

Java Graphics Rendering Bug

So I've been playing around with moving objects using KeyListeners and active rendering via while(true) loop. CANVAS.createBufferStrategy(3); BufferStrategy buffer = CANVAS.getBufferStrategy(); ...
0
votes
2answers
36 views

How to obtain the currently bound texture ID in an openGL ES 2.0 project

In my game, I have: GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, texID); Where texID is an integer returned by my setTexture() method. Let's say, in this instance it's 1. When I bind my textures ...
0
votes
0answers
57 views

ShapeRenderer is pixelated in libGDX

When I use a ShapeRenderer, it always comes out pixelated. But if I draw the shape in photoshop with the same dimensions, it's very smooth and clean-looking. My method is just as follows: package ...
4
votes
2answers
543 views

How To: Java Game to Steam Greenlight

I am planning to create an indie game using Java and Eclipse IDE and I want to put the finished product to Steam Greenlight. How does the whole process work after the game is finished and running ...
2
votes
1answer
82 views

AndEngine GLES 2 Animate Character [closed]

I want to animate my character in game. My graphic animator prepare for me three options. Frame-by-frame by this is over 9MB for one animation. With TextureSpriter 4-5MB. Spriter but I can't find ...
1
vote
2answers
208 views

Where should I put my game loop?

I've seen some tutorials on programming a good game loop, but none mention where (in the game code) I should call it. My guess is I should call it from the main() method. Am I right? Is there another ...
1
vote
0answers
54 views

Hiero Font not working [closed]

For ease of use I decided I would use the Skin class to make buttons and text, and the like, rather than draw them myself. So I downloaded Hiero to package a .ttf font into a BitmapFont and it all ...
2
votes
1answer
104 views

LibGDX collision detection on moving and rotating object (rectangle enemy) [closed]

i am trying to get collision dectection working properly but when i do it, the collision area keeps moving. no matter what i tried. there are 2 objects and the objects are moving and i cannot get the ...
0
votes
1answer
33 views

Generating multiple instances of one opengl object with random coordinates

Sorry if the question is dumb but my brain just cannot solve it for some reason.. So I've made one opengl object public static Square ball = new Square(75,75); And I am trying to make it so that ...
1
vote
1answer
79 views

Why isn't my background drawing to the screen?

Ok, So I have a game I have been working on for a few months now and I am now stumped beyond belief. My friend who has spent days working on this background gave it to me and I put it in my game. On ...
3
votes
1answer
351 views

How do I detect a tile map collision's direction? [duplicate]

I'm implementing collision detection with the map for my platformer. I have a method that generates a polygon on every tile and checks if the player hits it -- that's all fine. The problem is that ...
-2
votes
1answer
101 views

How does the minecraft main menu play a “movie” [closed]

I've been wondering for a while, and been doing a lot of research on the subject: how does the main menu in minecraft play a "video". As far as i can tell, it's not a .gif, it appears to be a movie. ...
0
votes
1answer
55 views

Libgdx Do a fixed rotation for orthographic camera

Im trying to rotate my orthographic camera in the render loop to a fixed angle, but I can only make the camera spin with the code I got: in the create OrthographicCamera camera = new ...
-1
votes
1answer
42 views

get current frame from an one row graphic [closed]

I need to get the current frame of a image but it does not work and I don't know why... Could someone help me pls... thx package com.android.testgame; import android.graphics.Bitmap; import ...
0
votes
3answers
283 views

Collision Error

I am having trouble with collision detection part of the game. I am using touch events to fire the gun as you will see in the video. Note, the android icon is a temporary graphic for the bullets ...
0
votes
0answers
30 views

Deleteing Textures in Android OpenGL ES 2.0

I'm confused about how to delete a previously applied texture. So, I've applied my texture and am happily rendering it. I decide I want to delete the texture, so this is what I've tried...... void ...
1
vote
1answer
3k views

Drawing hexagonal grid on Android

I'm trying to draw a hexagon grid in my Android application. I don't want to reinvent the wheel here so I'm looking for some frameworks/libraries or just some basic ideas about how should one do this. ...
0
votes
0answers
73 views

Using VBOs for the begginer

I've spent the past 10 hours trying to understand this and couldn't get any good help. I whatched a youtube video on VBOs and have whatched it many times and tried many things, but I STILL DON'T GET ...
2
votes
1answer
62 views

Failing Screen Resize Method

So I want my game to draw to a specific "optimal" size and then be stretched to fit screens that are a different size. I'm using LibGDX and figured that I could just draw everything to a FrameBuffer ...
0
votes
0answers
36 views

LibGDX stops drawing if I create a lot of Timer Tasks, but only in Android. Why is this?

I'm working on a few small games using LibGDX, and today I just started testing the first one on android rather than the desktop. A few seconds into the game, it stopped drawing. All my print ...