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
1answer
34 views

Which language is more proper for game development? [on hold]

I want to make and 2D RPG Multiplayer Game I already have really good ideas but I don't know what programming language should I use. I want to know your opinion, I want something with good library, ...
1
vote
2answers
572 views

libgdx ActorGestureListener.pan() parameters not moving actor in smooth line

I override the pan method in ActorGestureListener to implement dragging actors in libgdx (scene2d). When I move individual pieces on a board they move smoothly, but when moving the whole board, the ...
1
vote
1answer
18 views

How to draw the imagebutton and place it in the lower left corner

I have the button: soundBtnStyle = new ImageButton.ImageButtonStyle(); soundBtnStyle.up = skinBac.getDrawable("on");// soundBtnStyle.down = skinBac.getDrawable("off"); // soundsButton = ...
1
vote
1answer
37 views

Java Game Optimizing

I'm trying to optimize my game. I've got object Handler that goes trought all objects and then render and tick them. If I have lot of objects in game game lags or don't start. Could you please help me?...
3
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 ...
1
vote
2answers
80 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 ...
-1
votes
2answers
652 views

LibGDX Json not parsing full file

I'm trying to load a World with different Objects (World Objects and Entities). For that, I want to use Json. For less than two elements this works like a charm. But as I add more elements, some ...
0
votes
1answer
48 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 ...
2
votes
1answer
64 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 ...
3
votes
2answers
189 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 ...
2
votes
0answers
83 views

Generate camera shakes in Java

How would one of these work? (If you don't know what I'm talking about, think like in a game where you shoot a big gun, and your screen bounces in the opposite direction.) I've been experimenting ...
2
votes
1answer
137 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 ...
3
votes
2answers
827 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
26 views

How can I develop a simple Andoid game with basic 2D physics? [on hold]

I have a 2D game idea, and do not know how should I start. It is a simple game, where I should be able to stack up a lot of objects in a heap affected by gravity. Which framework (I have heard of ...
3
votes
1answer
532 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
2answers
47 views

OpenGL: Properly attach Texture

Problem: Been trying for hours to set a simple png of a cross hair as a texture (so I could later stick in the middle of the view like a normal cross hair), without luck. I'm coding in Java with ...
1
vote
0answers
35 views

How to rotate a sprite on touch/drag done on the screen wih Andengine?

when I look at the andengine examples I saw an example about rotate a sprite with joystick. Here is the code; final float y2 = (this.mPlaceOnScreenControlsAtDifferentVerticalLocations) ? 0 : y1; ...
2
votes
1answer
44 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
105 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 ...
2
votes
2answers
269 views

Accelerometer problems

When I hit an object, my Fighter is supposed to fall to the Ground. BUT, because of the Accelerometer, i can still move it up and down eventhough it died. The Scroller on the x-Axis though stops. ...
2
votes
1answer
3k views

How do I put a game on miniclip or addinctinggames?

I finished making a java game recently, and I would like to put it on a website such as Miniclip.com or AddictingGames. How would I do this? I have one more question. I know these sites could run ...
0
votes
1answer
501 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 ...
0
votes
2answers
46 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
0answers
11 views

Chartboost ads not showing on some Android Devices [on hold]

I had implemented chartboots ads in my Libgdx game. When I tested it, it worked properly and when I published the game it is working well on some devices, but it doesn't work on others. my friends ...
5
votes
3answers
145 views

Random black pixels GLSL shader bug

I've recently been following a tutorial for writing a game engine in Java using LWJGL 2. I followed the tutorial for writing a fragment shader that utilizes spotlights in GLSL. The example game ...
1
vote
0answers
16 views

Linking 3D Models together in libgdx (skeletal)

I'm drawing a 3D stick figure for an Android app using Libgdx and its ModelBuilder's createCylinder() and createBox() methods. In the render method I animate it by applying translations and rotations ...
0
votes
1answer
155 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....
2
votes
0answers
25 views

FillRecatangle set Opacity?

I have a game with "hud" which is drawn by fillrectangle. How would I fade these fillrectangles when the player is on the "hud"?
3
votes
2answers
6k views

How move sprite in Java 2d (swing) with keyboard?

I'm practicing some simple techniques with Java swing games, to learn the basics. Right now I'm practicing how to move a sprite... but it's not working! whhyyyy Here is what I've come up with so far (...
0
votes
3answers
68 views

Difference Between LibGDX and LWGJL

I've been looking into developing a small game with Java, as I am fairly familiar with it and see game development as good opportunity to improve my knowledge. When I research different libraries and ...
3
votes
2answers
74 views

Delay when moving elements

How you can see my mouse goes little bit faster than widget. My movement algorithm is: cursorPositionPrev.set(cursorPosition); cursorPosition.set(getCurrentPos()); ... Vector2f delta = new ...
4
votes
0answers
135 views

How to correctly implement 'layered lighting' with Box2D-Lights

How does one only allow Box2D-Lights to affect one and only one OrthographicCamera. After researching, I found the following answer. This answer goes into detail about how to prevent one camera from ...
1
vote
1answer
47 views

Libgdx black rectangles problem

I'm working on a game for Android using Android Studio with LibGDX in Java. I recently found a weird problem when closing and reopening the game. When I first open the game, it works fine. If I click ...
1
vote
1answer
70 views

Can't load png in texture

I created new project in libgdx without Android, specified for Eclipse. I added testcar.png to assests in core project, refreshed core and desktop projects, new Texture(Gdx.files.absolute("C:\\...
1
vote
0answers
18 views

How do I pool a bullet in libgdx ashley ECS approach?

I'm having problem creating bullet pool in ashley ECS approach, because i'm using PooledEngine, everything is pooled. So I've done is I just use engine.createEntity(), engine.addEntity() and engine....
1
vote
2answers
220 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 ...
3
votes
1answer
106 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
10 views

Libgdx Error in Importing chartboost. sdk

I am trying to add chartboost ads, I had added the jar file to my libs but when I am trying to import the chartboost sdk it gives me error and the whole lines of: import com.chartboost.sdk.Chartboost;...
1
vote
1answer
32 views

How to use GdxAI with libgdx ashley ecs framework?

I'm planning to use GdxAI Telegraph in GdxAshley ecs framework, my problem is how I'm gonna create a telegraph component if I wanted to dispatch a message? I have created AIComponent and AISystem. ...
2
votes
1answer
224 views

Java Reversi/Othello - Checking if Valid move

I've written a gameBoard class for a Reversi/Othello which is the following: import java.io.Serializable; public class GameBoard implements Serializable { private static final long ...
2
votes
2answers
69 views

How to pool child classes in LibGDX?

I have a super class named Monster which implements Poolable. Then I got child classes which extends from the Monster class, but I can not figure out how I will use pool and maintain only one set of ...
0
votes
0answers
31 views

Code review for Java multiplayer game base [closed]

I have been working on writing the base for a UDP based multiplayer game in java. So far, I have written: -a base server client interaction for clients to locate servers and join them -a swing app ...
1
vote
0answers
22 views

What is the proper way of creating bullet in libgdx ashley ecs framework?

I'm still thinking, how do I properly pool a bullet in libgdx ashley? Because the PooledEngine is available, which the Entities, Components and Systems are already Pooled. I made this below example, ...
0
votes
0answers
64 views

2D Map and Character Creation [closed]

I was wondering what the best solution for 2D map and character creation is? I’m looking for something like Pokémon or other top-down perspective. I’m programming in Java so far and know how to put ...
1
vote
1answer
48 views

Scene Transition in libgdx

How can I make transition between stages in libgdx ? I have 2 screens MenuScreen and GameScreen each of which has a stage I write the following to make a transition : in MenuScreen SequenceAction ...
1
vote
1answer
122 views

How to create 2D cameras in swing?

What is the best way to create a camera for a 2D platformer using swing, and I want to create a camera that moves instead of moving the background. This is because I'm going to have objects rotated by ...
1
vote
1answer
65 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 ...
1
vote
1answer
29 views

How to wrap ECS components to OOP in libgdx ashley?

Currently I am using builder-pattern to create my Entities PooledEngine engine = new PooledEngine(); ... CharacterComponent character = engine.createComponent(CharacterComponent.class); ...
1
vote
0answers
45 views

External gui within a render loop

I was wandering how easy is to interface existing Java programs/GUIs inside a game loop. Sorry if my question is a bit vague. I'll try to explain. I am currently designing a simulation environment ...
4
votes
1answer
44 views

OpenGL ES Frame Skipping causing visible artifacts

I'm using OpenGL ES 3.0 on Android 5.1, and am noticing the following issues. I tried to implement the game loop which does exactly 60 updates and do as many frames as it can. Everything is smooth, ...