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

1
vote
1answer
12 views

Load a simple text file through asset manager in libgdx

It's easy to load a simple text file from the internal: Gdx.files.internal("data/colors.txt"); But I currently use an AssetManager to load assets that are defined in an array of ...
2
votes
1answer
20 views

Endless Running Game - Changing Lane Function in JAVA

I am developing a kind of vertical endless running game, where the character has 4 possible lanes to be in. I am using libGDX and want the character to change lanes by adding a horizontal velocity to ...
0
votes
1answer
27 views

BitmapFont - where is getBounds method in new 1.6 libGDX

I download newest libgdx version 1.6 and i cant solve problem with center my BitmapFont text. Earlier in version 1.54 i used getBounds() method to find out width of text. Share your solutions, thanks ...
0
votes
2answers
30 views

Tilesets - how to make the pink color appear transparent

recently I searched for some free to use Tilesets on the internet. And wherever I found a sheet of sprites there is this pink color in the background. i know that all the spots having that color ...
1
vote
1answer
53 views

Java - Load new classes from a folder automatically at startup

I want to make my game-coding very flexible; so I wanted to make the game automatically load new Mobs from a folder named "mobs". This must be only at startup; not while it's already running. I just ...
0
votes
0answers
36 views

How to implement something as shown in the picture [on hold]

I am trying to make a game using libgdx framework problem: Initially screen is blank,then blue ball enters the screen from top, when blue ball reaches middle red ball enters,when blue ball reaches ...
1
vote
0answers
20 views

libGDX: Linking 3D scene from 2D screen

Using libGDX I have created a few 2D screens, such as a splash screen and a main menu, and also created a 3D scene which I want to be able to load when clicking a button on the main menu. I know how ...
0
votes
0answers
14 views

Login handler for server logic in Poker

I am developing the server side of a multiplayers Poker game. My server has zone/room architecture. If users want to enter a zone, they have to submit login information to server. After receiving that ...
-1
votes
0answers
27 views

Where can I find up to date LibGDX tutorials? [on hold]

I've searched day and night, rain and shine, high and low, and I still cannot find up to date tutorials for LibGDX. I don't want to develop games for Android, but all the up to date-ish tutorials are ...
1
vote
0answers
10 views

LibGDX and Sound Priorities

According to a post I found, the setPriority of a Sound in LibGDX is not only a hint, but does nothing on desktop, and I can confirm this. I really need priorities for sounds in my desktop game. The ...
0
votes
0answers
15 views

Help With 2d Java Game [closed]

Hello I'm working on a 2d side scrolling java game with a Breaking Bad theme. I am having a few issues getting my collision with my TileMap to work and also a slight solitaire effect. If anyone has ...
0
votes
1answer
34 views

How to read a custom map format [on hold]

I am trying to create a custom map format for my own little 2D RPG, so my question is rather how do I manage reading and creating a custom map format properly and flexible. First off, I am writing my ...
0
votes
0answers
21 views

JBullet LWJGL--— [closed]

How come i get this error:Exception in thread "main" java.lang.NullPointerException at engineTester.MainGameLoop.main(MainGameLoop.java:204) CollisionShape shape = new StaticPlaneShape(new ...
0
votes
0answers
26 views

how to allocate memory in java [closed]

Is there a way to allocate memory in java so as to simply make it unavailable? If there is i'm intending to use it as a way to constrain the resources available to me. When the game is complete i ...
0
votes
0answers
10 views

LWJGL Compatible Physics Engine 2D [closed]

Again I Am Looking for a 2D Physics Engine that is compatible with LWJGL since LWJGL doesn't have it's own Physics Engine to Handle It Collision Detection and such, Can anyone of you guys recommend ...
-1
votes
1answer
34 views

Java libgdx get clicked square without iter

I would like to detect which square is clicked without iterating over all elements! i don't want to do this anymore for all elements. if( x >= this.getAnchorX()-HalfWidth && x <= ...
1
vote
0answers
39 views

Drawing fonts with LWJGL3 with OpenGL

I'm very sorry if this question has already been answered, but since I've been struggling with this for many days I thought I'd give it a shot here. My goal is to somehow render some text on the ...
0
votes
1answer
39 views

Java 2D Game Hitbox Detection & Rounded Corners

I am working on a simple 2D game with Java, swing and no framework. I have a rectangular player that the user can move around. On the map are few obstacles which the player should not be able to go ...
0
votes
0answers
16 views

JBullet - Object is colliding at the wrong location!

I'm trying to make archers walk on my ship. I create the ship mesh like this: { Model mesh = null; try { mesh = OBJLoader.loadModel(new File("res/ship.obj")); } ...
0
votes
0answers
12 views

How to zoom and scroll in libGdx?

I am trying to both A.) Pinch zoom my game scene and B.) Move (scroll) my game scene but I have not found many examples. I learn more by examples than by reading API documentation (although I am ...
0
votes
1answer
28 views

Libgdx Actor touch undetected

I am looking for detect touch in an actor. The touch in my game is detected in wrong part of the screen. I want to detect touch only on the red circle, here is the code: Static_values public class ...
0
votes
1answer
16 views

How to map texture to shape in Slick 2D

I need to map texture to shape. Texture: This is a example of shapes I need to map texture to: Notice that each piece in mesh has exactly 4 point to map texture. Logic is pretty straight ...
1
vote
1answer
64 views

Rotating a swinging sword in LWJGL gives wierd results

I'm making a 2d top down game in Java using LWJGL(OpenGL, essentially). I recently tried adding a swinging sword mechanism. My coordinate system is set to the bottom left FOR ALL objects. The rotation ...
2
votes
0answers
27 views

LibGDX's HTML project doesn't show anything in Browser

The question is self explanatory, when I run my demo-html project as a Web Application and I open Chrome with the provided link by eclipse, my browser doesn't show the image it is supposed to show in ...
0
votes
1answer
80 views

LibGdx - How can I correctly handle tile transitions / connected textures?

So I am making a tiled game and I need to connect textures correctly based on whats next to it. With tiles that had connection really close to the edge of the tile I could just use the 4 bit meathod ...
0
votes
0answers
25 views

How to draw square composed of four triangles ? ( libgdx )

I've a case in which I need to draw square composed of four triangles like in the photo bellow : The triangles parameters are stored in the JDBC , I know how to draw shapes in Lbgdx but this kind ...
0
votes
1answer
26 views

Resultant Vector Of Circle Line Collision

For my game I need to have a circle collide against a wall and bounce off in the appropriate direction. I've looked around for a while and haven't found a good solution to my problem. I have a diagram ...
0
votes
1answer
37 views

Entitiy spawn on Button press

I'm trying to create a little 2D-Zombie-Shoot game. I'm pretty much at the beginning of programming. At least, I can create a player that is moving with arrow keys and stuff. My question is: How do I ...
0
votes
0answers
75 views

How do I manually create a .atlas file?

I am trying to learn Andengine, and it seems it does not support sprites in any other way other thab a Texture Atlas. I am using the Android AIDE app and importing the older Andengine .JAR because I ...
1
vote
2answers
64 views

Making an organized rendering class [closed]

I'm using LWJGL (opeengl wrapper for Java) and Don't know how to make a renderer class for OpenGL. So In Immediate mode rendering I'd do a method like this to draw quadralaterals. public static void ...
1
vote
1answer
55 views

Life Counter in Greenfoot caught “Incompatible Types” exception

I need to make a life counter so that when my Actor get hit by an Enemy, his life will be decreased by 1. I put this method in my Actor class: private void decreaseLife() { Actor enemy = ...
3
votes
1answer
125 views

Should UI be part of the game-loop?

I can't really find a good answer to this anywhere, I have never worked on games in a proffessional environment and I am wondering; Do these games render their UI in the main game-loop? That is, do ...
0
votes
0answers
37 views

How to get GestureDetector to work?(Problem with GestureDetector class)

I am trying to write simple program which would get input from user by swiping in four capital directions. I'm extending GestureDetector.java from libGDX and overriding fling method, but no matter ...
0
votes
0answers
21 views

LIBGdx - Kryonet with an InetSocketAdresse

I'm trying to implement Kryonet in my game and i'm facing some trouble. Using the source from the code i develop my server like that : try { this.server = new Server(); ...
0
votes
2answers
69 views

How would I create classes for each map tile instead of using a tmx? LibGdx

I am making a top down style game using LibGdx that I want to be randomly generated each new game load. I already have the algorithm to generate the array for what tile should be what. But i'm ...
0
votes
0answers
40 views

Should I handle mobile collision from the mob or projectile? [duplicate]

I have a fast tile collision setup and quadtrees for collision between mobile entities. I have been back and forth in my other games for if I handle projectile-mob collisions in player or mob ...
0
votes
2answers
68 views

Java libgdx Game Screens and rendering tile map [closed]

I'm working on a 2D tiled game with Java and libGDX. I'm having problems implementing gamescreens. I'm trying to set the screen to gameScreen and start rendering tiles, but I'm getting a nullpointer ...
0
votes
0answers
22 views

Sprite animation in Java? [duplicate]

I know this question has been asked many times but none of the answers were very clear to me. I'm working on a small Java RPG, and so far I can control a character (drawn onscreen with a .PNG sprite) ...
-1
votes
0answers
14 views

Errors with draw two images

I want to draw two images, but java create only one, please help. public class Game{ public static void main(String[] args){ JFrame frame = new JFrame(); Player player = new Player(); ...
-1
votes
1answer
28 views

How to make object to stop moving

I'am making the game in Java, and I'am make the object, and she move, but i don't know how to make it stop. public class Player extends JPanel implements ActionListener, KeyListener{ // Varibles ...
0
votes
0answers
18 views

LWJGL Using .setIntialBackground and Drawing Textures?

I have been trying to create a game with LWJGL, however I have recently discovered that changing the background color using Display.setInitialBackground() with glClear and trying to draw a texture at ...
-2
votes
0answers
26 views

libGDX interface cannot be applied error

I would like to use interfaces in libGDX. I get an error in AndroidLauncher before compile. It says for this line: initialize(new MyGdxGame(actionResolverAndroid), config); .... cannot be ...
0
votes
0answers
309 views

Body gets recreated [closed]

In my game you have the Square, which is the player, and the Circle which is the enemy, the player carries a weapon, when shooting the game calculates where to place the bullet in relation to the ...
0
votes
1answer
63 views

Implementing Spine animations in Libgdx

I've been searching a lot for a guide on how to implement 2D animations exported from Spine to Libgdx, but all I could find was outdated tutorials and source codes. I can handle basic Libgdx but Spine ...
2
votes
2answers
101 views

AI for Shogi, dealing with high branching factor due to drop rule [closed]

I'm writing a Shogi program with a computer player in Java from scratch as my undergradute dissertation project. Due to the drop rule, when the computer player captures a few pieces, the branching ...
0
votes
0answers
32 views

Store a Unity map on server-side

For a 3d Hack'n'Slash game I am currently using Unity as client and Java wit OGserver (Netty with some game-related features) as Server. I am on the map part of the development, actually I just have ...
0
votes
1answer
59 views

OpenGL ES 2.0 2D-Image displaying

I have followed the official OpenGL ES tutorial to create a working OpenGL-environment. I have been able to do anything I wanted to except for displaying 2D-images. To do so I worked through this ...
0
votes
0answers
34 views

In Java swing, while handling a 2D top down game, how should I handle scaling for quality transformations (mainly screen rotation)

For my top down game, I plan to have screen rotation where entities don't rotate, but everything else does. I am using a raster array to store my image so I don't have to render things stacked on each ...
0
votes
1answer
81 views

2D planetary system simulation- how to improve gravity model? How to control simulation speed?

I'm making a simple planetary system simulator. I've run into some problems with physics model and simulation speed and I'd like to learn how to fix them. My main class is Body: public abstract ...
0
votes
1answer
42 views

Libgdx distorted texture size

I'm just starting to learn LibGDX and have been having some troubles getting my world size to match with my texture size and box2d bodies. I have a texture 64x64 that I am trying to display but it ...