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

1
vote
1answer
26 views

Anti-Aliasing Problem

So, I was annoyed by how the HUD for my GameState was very pixel-ated and I wanted to change that through the use of anti-aliasing. However, it works with a small exception: It adds all these lines ...
0
votes
0answers
14 views

How could I add XBox 360 Controller handling support to my game?

The title says it all. I'm making a 3D Open World game with OpenGL and LWJGL in Java, and I really need to move in several angles to fully feel inside the game. The problem is that I couldn't find any ...
0
votes
1answer
24 views

onHold input libGDX

I want to have onHold or onTouch input for my game. So as long as the user touches the screen something happens (a car moves) and when he stops touching the screen it stops. How do I do that? I want ...
-1
votes
0answers
12 views

On touch input Libgdx [duplicate]

I want to have an on hold or on touch input for my game. So as long as the user touches the screen something happens (a car moves) and when he stops touching the screen it stops. How do I do that
-1
votes
0answers
13 views

How do I increase or decrease the background movement speed (libgdx) [on hold]

I making a game using libgdx and I want to know how to increase or decrease the background movement speed this is what i tried public class PlayState extends State { private int tubeSpacing = ...
0
votes
0answers
6 views

Libdgx and Overlap2D export settings for Android

So I have a problem when exporting assets from Overlap2D to Android Studio project location. When setting up libgdx I set the project to be for desktop and android and selected Overlap2D extension. ...
-1
votes
0answers
16 views

How to make the interaction of sensors is in box2d? [on hold]

can not figure out how to make the interaction of the sensor platform has become active. something like this: BeginContact { if (sensorA && sensorB){ platform.getBody () ...
0
votes
1answer
63 views

How does one structure a Player GUI

I am using Java and the Slick2D library. I've been testing around with ways to develop a Player Graphical User Interface (GUI) (to show armour, items picked up, weapons equipped, etc). The one ...
0
votes
0answers
5 views

LibGDX Child node is not following animation

So I'm trying to place a golf club as a child node of the hand of our "golfer", so it follows the animation the golfer has when the animation is invoked. However, once I hit "Check Swing" (the button ...
-1
votes
0answers
51 views

Implementing gesture detection in LibGdx

what I tried: public class PlayState extends State implements GestureDetector.GestureListener { private Protagonist bird; private Texture bg; GestureDetector gestureDetector; ...
0
votes
0answers
20 views

Making my game scalable? [duplicate]

I'm quite new to games development and just recently I've made my first Java platformer. I've been using Graphics2D to draw my spritesheets, but I've heard this method isn't very good in terms of ...
-1
votes
0answers
13 views

Reverse CopyOnWriteArrayList [closed]

How to reverse already sorted (by asc.) CopyOnWriteArrayList, when Collections.reverse(list) gives out error for this type of list? By the way, I need to use CopyOnWriteArrayList.
0
votes
1answer
61 views

Network interpolation wont work for local player

im currently developing a little duengon crawler. It should have lan multiplayer and it works great but i think im sending to much packets. Should i send packets over network, when a player moves in ...
-1
votes
0answers
20 views

how to move with update trajectoryPointCount [duplicate]

I am a new game developer, I am making a game, but I have a problem, I don't know how I can update my trajectory point in OnDraw method. Could anyone please help me? Thank you! enter code here ...
0
votes
0answers
55 views

Multiplayer through blocked Firewall Ports?

im currently trying to develop a little game. I thought it would be a great idea to implement coop multiplayer, only lan. So i took kryonet and created a server. On my home wlan it works great im able ...
0
votes
0answers
56 views

How to update projectile trajectory point?

I am a new game developer, I am making a game, but I have a problem, I don't know how I can update my trajectory point in OnDraw method. Could anyone please help me? Thank you! Here is my code: ...
1
vote
0answers
45 views

Libgdx stops all sounds when there are lots of sounds

I'm making a 2D game for Android using Android Studio with Libgdx in Java. I have a class, called SoundPlayer, which holds an ArrayMap. The key is the name of the sound file and the value is the sound ...
0
votes
1answer
13 views

InputProcessor without stage

I have a GameScreen where I'd like to have a pause button. I've tried using an Image with a listener, but since my GameScreen isn't a stage, I can't use that in the inputProcessor. So my question is ...
0
votes
1answer
38 views

How to resize 2D Java game without “squeezing” it?

I am trying to make my second java game (2D) but i have run in a problem: The game will be in fullscreen, but how can i make it so it is scaled properly for each screen? While researching i found out ...
0
votes
0answers
22 views

TiledMap Safe Area for different screen resolutions

I'm creating a Tower Defense game using libGDX (w/ scene2d) and TiledMap. I've been reading extensively about viewports and how I can better manage various screen sizes. I want my Tiled Map to take ...
1
vote
2answers
50 views

OpenGL [LWJGL3] - Matrix4x4 not rotating correctly

I tried today to make my own matrix4f class because of that LWJGL 3 does not include a class for it. So I arrived at rotation and it does not seem to work. I tried using the old util from LWJGL 2 and ...
0
votes
1answer
43 views

Simplifying Object Factory

I'm making a game for Android using Libgdx with Android Studio in Java. In my game, I have a class called ObjectFactory which has a method createGameObject(int objectType) which receives an integer ...
5
votes
2answers
593 views

Main game objects as static

I'm making a game for Android using Android Studio with Libgdx in Java. In my game there are main object like Screen, ObjectFactory, SoundPlayer, Painter (Responsible for drawing) and a few more. 'til ...
0
votes
0answers
29 views

Defining camera/view space

Im working on expanding my camera class, but having trouble defining camera/view space in the manner of this diagram: What Im trying to achieve is to define the camera as a true object much like a ...
0
votes
3answers
48 views

How to scale bitmap font without having it pixelated

How do i increase the size of a bitmap font without having it get pixelated, in libgdx?
0
votes
0answers
17 views

AdMob Banner appears 960x150 instead of 320x50 in libGdx - what's wrong here?

I am a bit helpless with this strange effect from AdMob. AdView is instanciated in code and so is the relative layout and libGdx view. View view = ...
0
votes
1answer
39 views

How create/draw faded circles in Java

How do I create some circle - like the one on the image - in Java, and in various colors? I would like to make more of these circles to fly from specific position to random direction.
-1
votes
0answers
30 views

How do I render a random picture to the screen each time game is initiated lib gdx [closed]

how do I render a random texture on the screen each time my libgdx game is initiated.
1
vote
0answers
33 views

Best way to create defence(withdraw) algorthim libgdx?

I have created user body and enemy body. Enemy body uses the steering behavior created by gdx AI. User body have it own control inputprocessor. World doesnt have gravity. Enemy body arrives the user ...
1
vote
1answer
39 views

Collision Detection Unresponsiveness

I'm creating a simple jumper game in Libgdx that makes the player jump over obstacles in order to stay alive. The only problem is that the collision detection for when the player just touches the ...
3
votes
1answer
146 views

Simple way to serialize save game data whilst allowing for future features

Is there a simple way to 'serialize' the game data of my game, but protected it from being unloadable if I add new fields? I have all the data in a single class, GameData.java, and I want to avoid ...
0
votes
0answers
22 views

libgdx - Math reflection to the correct direction

I'm using a simple reflection system, but the game doesn't work how I want. How should this game work? The game has two boxes. A red side and a black side. The player should only sort the bombs to ...
0
votes
1answer
35 views

Libgdx Sprite rotation around specific point

I made complex dynamic body that rotates around other body that is static. It works perfectly, however I got messed up with sprite position on that body. Here's what I have now and here's what I ...
0
votes
0answers
45 views

Why is my tiled map moving when I move the camera in libGDX?

I use LibGDX. I have created a map with Tiled Map Editor and loaded it to the game. Everything else is working well, but when I move the camera, the map moves: it jumps or floats. My code: public ...
0
votes
1answer
44 views

SceneGraph in Entity Component System, Transformations

I'm recently learning entity component systems, and started implementing it into my test engine, however I'm having an issue integrating this with scene-graph, which I'm trying for the first time. ...
0
votes
1answer
28 views

Libgdx shaperender within a circle as limitter

I encountered a problem, where my small entities would be rendered out of the bounds of my radar. At the time I solved it like this: ensure, that the object would be within the circle, but, that's ...
1
vote
0answers
30 views

Java Libgdx Attaching Sprite to Box2D Body

So I am working on programming a java 2D platformer for fun on the side and I have a rendered TMX level and a box2d body (just a circle shape) that I am currently using as my player. All the controls ...
0
votes
0answers
27 views

LibGDX - black bars, FitViewport and drawing background

actually I'm creating game in LibGDX and i have few problems. I'm trying to solve resolution and aspect ratio problem by using FitViewport but i want to dispose black bars which occur when resolution ...
3
votes
1answer
134 views

How do I get A.I. that follows a list of movement commands to move smoothly in a tilemap based game?

This is for a school project so it's not intended to be sold/fun/or a complete game, rather just a demonstration of stuff we've learned without resorting to frameworks and stuff. My ai agents choose ...
0
votes
0answers
14 views

Move ball through a direction angle in android canvas [duplicate]

I am building a simple game in android. I am successful in first step where I draw a ball in canvas in touch point. Now I am trying to move it from an initial point A (center) through the touch point ...
0
votes
1answer
62 views

libgdx - Math for wall collision when adding velocity

I've created a game which spawns a random colored ball in the top or bottom of the screen and moves to random direction with this method. private Vector2 position; private Vector2 velocity; private ...
0
votes
0answers
26 views

How can I simulate a basketball throw in LibGdx box2d?

So I want to simulate a similar throw like in the game Bouncy Basketball. Do i need to create a body and attach another body on it that would be the arm and then how would I apply force/impulse to the ...
1
vote
1answer
30 views

Circular Movement

if (Keyboard.isKeyDown(Keyboard.KEY_D)) { if (i < 360) { setX((float) (groundState.getX() + groundState.getRadius() * Math.cos(Clock.delta() * i))); setY((float) ...
1
vote
0answers
38 views

libGDX text doesn't appear in TextField

A game I'm working on has libgdx's TextField. They work fine in every instance I've used them, however on a play tester's phone he says no typed text appears in the box until enter or space is ...
0
votes
1answer
16 views

How do I know if the ad is open while the use pressed the back button?

I am trying to reward a user a point whenever they watch/look at an ad. I give the user the reward whenever they watch the ad. However, the user earns a point even if they go to the ad and click back: ...
0
votes
1answer
35 views

What does the TextureRegion.flip() method do?

I'm learning libgdx and don't understand the purpose of parameters passed to flip(boolean x, boolean y). For example, I have code like this: texture = new ...
1
vote
0answers
53 views

Slick2D fails to load small textures

I'm trying to load a small 32x32 png texture using Slick2D, however it doesn't seem to render correctly. What's odd is that larger textures do load correctly. The 32x32 texture I'm trying to load: ...
-1
votes
1answer
43 views

Exception in thread “Thread-0” java.lang.IllegalArgumentException: input == null! [closed]

whenever i run my game i get this Error. Exception in thread "Thread-0" java.lang.IllegalArgumentException: input == null! at javax.imageio.ImageIO.read(ImageIO.java:1388) at ...
0
votes
1answer
37 views

Canvas doesn't draw

I've set app view on XML based layout: setContentView(R.layout.mlayout); with some views objects on it. Then, I added another view via: RelativeLayout layout = (RelativeLayout) ...
0
votes
0answers
20 views

Ads are loading, but not showing?

TL;DR: My interstitial ads in my game are successfully loading, but when I call .show() on them, they don't show up! I have followed these directions, and the ads load succesfully, but don't show ...