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

2
votes
0answers
61 views

How can I connect multiple explorable regions into one large map?

I am planning a 2-D science fiction game involving spaceships. A major thing that I am having trouble figuring out is how to create a 2-d array of smaller maps that the player can explore. My ...
-2
votes
2answers
298 views

How can I display an image for a predetermined amount of time?

I want to display an image, then return to the previous after one second when a certain key is pressed. I'm using Slick2d and Java. How can I accomplish this?
0
votes
0answers
31 views

Paint objects cause lower FPS by time

I'm creating squares on XML layout with Paint, you can see how exactly bellow: public class PaintObject extends View { Paint paint; public int x; public int y; public PaintObject(...
0
votes
0answers
19 views

Box2d Body filled with a texture Libgdx

I have a simple triangular shape (obstacle) in my game and i would like to fill it with a texture repeatedly. I have looked at the other 2 topics but couldn't find a working solution. How can i fill ...
3
votes
1answer
99 views

2D Map Editor Tiles Palette - Best suited Java Elements to use?

I'm making a 2D RTS Map Editor and here came the moment to make a Palette which is just a popup frame showing tiles to be clicked on and then applied on the map. I'm wondering which Java Elements to ...
0
votes
1answer
34 views

LIBGDX: Translate grid drawn with ShapeRenderer with an OrthographicCamera

I am trying to draw a grid for my "world" that may or may not extend beyond the screen. What I would like to do right now is draw the entire world (which is relatively small) and then use the ...
0
votes
0answers
20 views

Problem with automatic ragdoll shape generation using Bullet

I'm trying to automatically generate ragdoll colliders (for now, box colliders) from my mesh. First of all, I specify the body parts like so: ragdoll.setRagdollBone(Ragdoll.RagdollBodyPart....
0
votes
1answer
75 views

Drawing bullets on a map

I'm going to be making a shooter-style game, on a navigatable map (All 2D). I'm a little unsure of how to handle the bullets: I see two main ways i could do it I could have the bullet's x and y ...
0
votes
0answers
38 views

Decrease force in a zero gravity world

I have a world with zero gravity. On a mouse pressed I apply a force so things drive away from the mouse. The problem is now that they keep on flying. How can i make them stop? box2d.world....
0
votes
0answers
12 views

JPopUpMenu in JAVA using swing

I am working on a java application, i just added a popup menu on JTable, evrything work just fine but when i click inside a cell to edit it's content and click back out side and then when i try to ...
0
votes
0answers
35 views

Removing no longer used paint out of screen

I have Paint, like this: Paint paint = new Paint(); paint = new Paint(Paint.ANTI_ALIAS_FLAG); paint.setStyle(Paint.Style.FILL); paint.setStrokeWidth(5); paint.setColor(Color.BLUE); and I'm drawing ...
0
votes
1answer
54 views

Java multiple player objects/enemy objects?

NOTE: I'm a beginner and learning :D Alright, so in my game I have a class for the player (with the parameters of x, y, color, width, height, and health, same parameters with the enemy). But I have a ...
2
votes
2answers
351 views

Filling in 3d Shapes

For a college project I need to draw an empty cube and then show the cube being filled. So far I have heard that JME and voxels is the way to go but I have no idea where to start. Can anyone point me ...
1
vote
1answer
127 views

libgdx FollowPath proper usage

I'm developing top-down rpg game and got some problems using https://libgdx.badlogicgames.com/gdx-ai/docs/com/badlogic/gdx/ai/steer/behaviors/FollowPath.html I have a path (picture 1), in this case 2 ...
3
votes
1answer
85 views

Just how expensive is it to bind textures in OpenGL? (LibGDX)

I'm using LibGDX on top of OpenGL and currently my game engine does something along the lines of the following per frame Bind a terrain texture sprite atlas and a set of transparency masks in ...
0
votes
2answers
105 views

Java, spawn algorithm that gets harder each level

I am currently in the process of making my 3rd Java game (everything I have learned is from YouTube videos, so I may be doing some things wrong) named "Blocked". But I have run into a problem: how do ...
-1
votes
1answer
72 views

Game puzzle pop in java [closed]

I am making a game in Java based of those puzzle popping games. The objective is to select with the mouse and remove a tile. The game i want to build. I have a JPanel and on top, several Components, a ...
7
votes
1answer
101 views

Perspective-Correct Texture Mapping

I am working on a small rendering engine for a personal project and I am having issues with the texture mapping part of it. It seems to work for some cases, but not for others. For example, when one ...
0
votes
0answers
32 views

How can the new Yggdrasil Minecraft authentication be utilised in java?

A while ago I had a custom launcher for my modpack in minecraft and it used the old login.minecraft.net method of authentication but now I see they have changed this method. Here is a link to the new ...
4
votes
2answers
188 views

Poor performance wth custom particle system in LibGDX

I'm using a custom particle system for my LibGDX / Java based game project (because I used Slick2D earlier on, need more parameters so I made my own and then ported). The system is fairly standard as ...
0
votes
2answers
83 views

How is it possible to call abstract methods from another class? [closed]

Im creating a game using LWJGL and just as a bit of organising I made an Abstract class called Game so I could extend Game in my main class The game class is like so - public abstract class Game { ...
0
votes
1answer
50 views

How to export slick2d game into a jar with the res and native folder

I am a beginner in Slick2D. I use jarsplice to output Slick2D game. But it is export all thing into one jar. I want to export one jar with the res and native folder .... So I can easily modify ...
0
votes
1answer
45 views

TliedMap render use 15%cpu

I am a beginner in Slick2D. I used TiledMap render in my game,but I do not know why it use 15%cpu and how to fix it. I used map is 1024*768. This is a part of my code. Thanks for any help public ...
0
votes
1answer
50 views

Slick & LWJGL Flickering Problem

I have an flickering problem with rendering tiles. Rendering Method. int tileSize = TileManager.tileSize; for(int y = 0 ; y < mapHeight ; y++){ for(int x = 0 ; x < mapWidth ; x+...
1
vote
3answers
1k views

How to make an Actor follow my finger

I'm back with another question that may be really simple. I've a texture drawn on my spritebatch and I'm making it move up or down (y-axis only) with Libgdx's Input Handler: touchDown and touchUp. @...
0
votes
1answer
29 views

Libgdx - changing tiledmap smoothly, Tween engine maybe?

First question here, so bare with me if I make a mistake or two. Long story short I'm currently developing a side scroller game in java with libgdx, which uses tiledmaps from the tiledmap creator ...
0
votes
1answer
20 views

LibGDX - Shader not being applied

I've recently encountered a strange problem with my program and I can't seem to fix it. When I try to apply a shader to my SpriteBatch it doesn't change. I've debugged this problem like so: if (test) ...
1
vote
1answer
60 views

How to jump in Box2D with LibGDX

I am making a 2D platformer in LibGDX with both Ashley and Box2D. I have it so, that the PlayerControllerSystem watches for the jump key being pressed: // Jumping if (Gdx.input.isKeyPressed(...
1
vote
0answers
55 views

What is the most efficient way to store world data for a 2D tile game? [closed]

I'm working on a 2D tile based survival game for my programming class and as I was working on GUIs I realized that I would need an efficient way of storing and recalling not only the tile data and ...
0
votes
3answers
86 views

LibGDX simple button with image

I want to make two image buttons (play, restart) in my main menu screen but I dont know how to do it. I tried this: Texture playTexture = new Texture(...) Image playImage = new Image(playTexture) ...
2
votes
1answer
2k views

Calculating trajectory

I'm just starting with game development and some physics related to that. Basically I want to calculate a trajectory given an initial velocity and as well as an elevation / angle. So I wrote this code ...
0
votes
0answers
32 views

HorizontalScrollView with multiple views in one “frame”

I have ImageButton, with TextView and ImagaView inside it. I have six of these. So I want to implement them into HorizontalScrollView. I remember I had one HorizontalScrollView with images some time ...
1
vote
1answer
40 views

Java- Trig based movement

I have been trying to create a smooth movement technique that would allow me to move in all directions, not just the 8 cardinal directions. I have tried to use this doing trig, and while the ...
1
vote
1answer
59 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) findViewById(R.id....
1
vote
1answer
618 views

Random Sprite Speed

I followed the Rain Catcher tutorial from libGDX and I made some modifications to the code, allowing the rain drops to appear faster. But I cant figure out how to make the raindrops fall at random ...
8
votes
4answers
4k views

Looking for JMonkeyEngine tutorials and documentation [closed]

I'm looking for tutorials and documentation for JMonkeyEngine, beside the material on the official website. Any clue?
-2
votes
2answers
364 views

Absolute newb Java programmer seeks “dumbed-down” tutorials/resources [closed]

I understand the basics of Java and Object Oriented Programming so far, and am still working on refining my understanding of it. I have sought several different resources - two books and Oracle's own ...
2
votes
3answers
6k views

Where can I find tutorials for LWJGL? [closed]

I don't know if this is against the FAQ so if you close this, it'll be no surprise. I have done research but all the tutorials I have seen have been to hard to follow; I reckon there are better ones ...
1
vote
1answer
2k views

JMonkeyEngine in Eclipse

I wanted to try the JMonkey engine, so I downloaded the JMonkey sdk, but I don't want to work in the JME IDE, I would rather like to work with Eclipse, since I already started a game project there, ...
0
votes
1answer
692 views

Break a learning barrier with Java + LWJGL [closed]

I have been coding with Java and LWJGL for some time. I mainly use thebennybox's tutorials, but I can't always remember the 3D rendering. But even when I have a 3D rendering models, planes, cubes, etc....
1
vote
1answer
540 views

How to use LWJGL Vertex Buffer Objects?

I have been learning how to make a game with LWJGL for a while now by following YouTube tutorials online but I've recently been having a problem understanding Vertex Buffer Objects. I've looked at ...
2
votes
0answers
39 views

Pre-existing voxel tools/libraries for Java [closed]

I want to do some development using voxel data as well as rendering it. My interest is more in the project its self, rather then things like working out rendering optimization techniques and working ...
0
votes
1answer
28 views

Position of an object relative to another in a 2D plane

I have two objects, A and B, each of them has a set of coordinates (x,y). How do I understand where is A in relation to B's position? If I where to just check each coordinates I could do it like this:...
1
vote
1answer
69 views

How do you create a funky moving background?

I'm trying to create something similar to what you would see if you loaded a song in Windows Media Player (the cool abstract background that moves and produces various colors). I have no idea how this ...
4
votes
1answer
154 views

RAM usage unusually high, but CPU usage relatively low

I've created a relatively simple game using libgdx, but the RAM usage when I start up the game on my Android device is roughly 600-700 mb, but the CPU usage is only about ~0.05%. I've downloaded a ...
0
votes
1answer
56 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 ...
0
votes
0answers
15 views

Actions.fadeOut doesn't work when called on stage root

I'm trying to fade out my screen when a button is pressed, but the following code doesn't work: public void switchScreen(final Game game, final Screen newScreen){ stage.getRoot().getColor().a ...
-3
votes
2answers
81 views

Is it possible to use Java as a scripting language in unity? [duplicate]

I wonder if its possible to use Java as a scripting language in unity to create a basic 2d game?
1
vote
2answers
709 views

Libgdx box2d crashing

im making a game in libgdx which i having a bunch of circle bodies floating around in space and when the player's body crashes into another body, that body deletes and creates two smaller bodies ...
2
votes
1answer
71 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 ...