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
35 views

Why am i having major performance issues in my render method, Slick 2D?

I'm making a game using slick 2D and I was just testing a new method which got a sprite from a sprite sheet. While rendering 1 tile was fine at about 3000fps, filling the whole screen made the game ...
2
votes
0answers
11 views

Pre-existing voxel tools/libraries for Java [on hold]

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
0answers
6 views

Physics Body editor loader collision detect

In my game I use the Physics Body Editor to add custom shapes to my bodies. In my show() method I use the follownig code to create my Jetski Body: BodyDef jetskiDef = new BodyDef(); ...
0
votes
0answers
11 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 ...
0
votes
2answers
33 views

Slingshot gravity effect

I am trying to make a sling-shot that fires a projectile. I want it to act like the standard sling-shot in angry birds. So far I managed to get the "pulling" effect, ie. If I draw backwards it fires ...
0
votes
0answers
19 views

Java LWJGL and Slick2D collision with 2d array based map

So I've been making this game recently in java w/ LWJGL (2) and Slick2d. I've done some stuff like the map; it's a simple 2d array it goes through it and based on what id it is its gonna draw that ...
0
votes
0answers
27 views

How to get set up with java, eclipse, and slick 2d?

I have some experience in Java and other languages. I want to make games in java, and through my digging around it seems the LWJGL library is the way to go. I am trying to use Slick2D ...
0
votes
0answers
30 views

libgdx drawn a projectile trajectory cannot render

I am looking to draw a projectile trajectory . I found a lot of code such as : http://blog.gemserk.com/2012/07/03/drawing-a-projectile-trajectory-like-angry-birds-using-libgdx/ The code I editor; if ...
0
votes
1answer
34 views

My Sprite is disappearing when it collides with my floor (libGDX)

I am just starting to build the game "engine" and I am using a sprite drawn in the same position as a rectangle and the two always move together. I have another rectangle which is the floor when the ...
0
votes
0answers
10 views

Centering an animation [libGDX]

I have the following class: public class AnimationDemo implements ApplicationListener { private SpriteBatch batch; private TextureAtlas textureAtlas; private Animation animation; ...
0
votes
2answers
27 views

How to close an app correctly on desktop?

When I use Gdx.app.exit() the game window closes but the resources don't appear to be released and the app is still running. For instance, to exit on when the escape key is pressed: public boolean ...
0
votes
1answer
47 views

deformable terrain

I'm currently working on a 3d sandbox mmo and would like to know what would be the best way to store the terrain of the world. I was thinking about making some kind of mesh, like the kind you would ...
0
votes
0answers
19 views

Controlling when a Java game repaints

I've been learning how to program game loops lately and the issue I'm running into at the moment is figuring out how to repaint my window only when I tell it to. I suspect that my issue is not fully ...
1
vote
1answer
44 views

storing game options in java

I'm making a game using java. I'm wondering what would be the best way to store games options (like screen height and width, full screen boolean and many other similar options the user can select) at ...
-1
votes
1answer
76 views

Shoot-Em-up: Combinational key input problem [duplicate]

Lately, I've been implementing the shoot-em-up game -- the type of game that a player tends to hold the shooting key and directional key simultaneously in most situations. The problem that I'm facing ...
0
votes
1answer
29 views

How to make a levels map page?

I'm trying to make a levels map page that shows number-buttons in the page. I want to make this page in a XML layout file and I'm actually trying to make something like this: I know that I should ...
0
votes
0answers
27 views

How to detect number of pointers being used on screen?

I wan't to be able to detect if the screen is touched by two fingers at the same time. final int MAX_NUMBER_OF_POINTERS = 20; int pointers = 0; for(int i = 0; i < MAX_NUMBER_OF_POINTERS; ...
0
votes
1answer
116 views

Server/Client architecture

I have high experience In Java and Networking. Our team have built a effective server that can create thread-pools managing many players. But we have hit a brick-wall. The way our server works is that ...
0
votes
1answer
17 views

Java2D tinting image

I wanted to know how to tint a (Buffered)Image in Java With "tinting" I mean that black pixels stay black and grey/white pixels become the colour I want. Of Course not all pictures are grayscale I ...
0
votes
1answer
87 views

Improve (adding randomness) minmax algorithm for Connect Four

I have implemented the minmax algorithm for the Connect Four game. It works well (almost...), but if the player does the same moves, the computer will do the same moves as well, for each match. There ...
2
votes
1answer
48 views

Pixel thin lines appearing between sprites on camera move

I'm going to apologize in advance for the lack of screenshots, but this was a very hard thing to capture, but very obvious to see. I'm using LibGDX to create a tile base rogue-like. Everything is ...
0
votes
1answer
56 views

States within a GameState?

I ended up coming up with having states within game states. For example: States splash menu tracks garage loading play What bothers me is that I now have states within the play state to handle it ...
2
votes
3answers
106 views

Fastest 3D bounding box algorithm

I am at the point in my game where I need to add a collision system. I tried jBullet, and while it did work, it wasn't what I was looking for. I just want a simple way to test if two oriented bounding ...
0
votes
0answers
38 views

Converting glsl shaders

I need to convert these shaders from #version 400 core to #version 130 successfully but for some reason when I do it my models are not rendering properly when I load more then one type and I cant find ...
0
votes
0answers
47 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 ...
0
votes
0answers
15 views

Lwjgl 3 texture not rotating

My create Texture public void createTexture (String path) throws IOException { decoder = new PNGDecoder (new FileInputStream (path)); buf = ByteBuffer.allocateDirect (4 * (origWidth = ...
0
votes
0answers
44 views

Faulty AI for Connect Four game

I'm trying to implement the mixmax algorithm (without alpha-beta pruning yet) for the AI for the Connect Four game. I know that there are a lot of papers with the best rules to handle this kind of ...
-1
votes
0answers
42 views

How do you calculate when a second has passed?

I am trying to calculate when a secound has passed. It cannot use a while-loop, due to the fact that it will distract the main game loop, and will either lag the game to hell, or stop the game from ...
4
votes
1answer
94 views

Is there an optimal method to implement moving background?

I am trying to develop a little game using libGDX. We have a hero who jumps and world consist of dynamically created moving platforms in an auto side-scrolling manner. I wanted background to scroll at ...
-1
votes
0answers
18 views

How to create a view following an object

I currently have a JPanel inside a JFrame and I want a way for the "view" to stay attacked to a moving object, I currently have planets orbiting a sun and I would like the window to focus on a planet ...
1
vote
1answer
50 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) { ...
0
votes
1answer
25 views

Dealing with Spritesheets - resizing

Let's say that I have a spritesheet with 4 sprites (standing, breathing player). When I load it with player_bitmap = BitmapFactory.decodeResource(resources, R.drawable.player_standing); it sets ...
0
votes
1answer
61 views

How does one make maps with chunks in Java?

As of right now, I'm making my first Java game. It is an old Pokémon-style video game RPG. I'm fairly new to Java, but I'm fluent enough to read code and understand how it works. Anyway, I'm mostly ...
0
votes
1answer
23 views

3D mesh culling issue, further faces showing through closer faces

I'm trying to render a generated mesh using libGDX which acts as a java wrapper for openGL. The issue i'm having can be seen in the screenshot below. The faces of the mesh that should be hidden by ...
-1
votes
1answer
42 views

precedurally generate blob-like surface?

Just looking for some direction, I'm making a 2d top-down game and need to make some random shapes for an asteroid surface. I want to have so control so I can have not too-circle-ish but not ...
0
votes
0answers
21 views

Influence of network-hardware on Java NIO performance

To what extent, if at all, does the underlying network adapter (for example USB-WLAN-Adapter vs pci-ethernet-card?) affect the performance of Java NIO? I'm using KryoNet for my game-server networking ...
0
votes
1answer
63 views

Funnel algorithm

I'm implementing the funnel algorithm for pathfinding. After searching many resources I found those : https://skatgame.net/mburo/ps/thesis_demyen_2006.pdf ...
0
votes
0answers
36 views

OpenGL One Color Per VBO

Recently I have been working with OpenGL, and have decided to use colors instead of textures. However, since the project I am working on is going to have a low-poly look, I want each color to stand ...
0
votes
2answers
33 views

Most efficient way to mass render tiles in java slick2D [duplicate]

So I am trying to make a tile based game, it is rendering about 40 tiles on the screen at once. I get about 40 FPS on an okay computer. When I tell it to not render the FPS jumps to around 400 so I ...
0
votes
1answer
33 views

Modify Element of Struct Array

I have this struct array in GLSL. struct Test { vec2 value1; vec3 value2; float value3; } uniform Test u_test[5]; How can I modify the elements of this array one at a time? I know that ...
0
votes
1answer
16 views

Annoying snag when moving with dx and dy JAVA

I am currently using a keyAdapter with detectors and when I move I change the value of dx and dy respectively. However if I move left then right or up then down quickly, the sprite won't move in the ...
0
votes
1answer
45 views

Delay between bullets java - new Thread

Let's say that I have a cannon on the bottom of the screen that shoots balls to the click direction. I also have some collisions algorithms and here comes the problem. I am trying to implement an ...
0
votes
1answer
20 views

Box2d java contact point reference changes after collision

I am trying to hold the contacts made during a collision in an array list. After I add n amount of contacts, when I try to retrieve them later on, they point to the last contact made in the world. ...
0
votes
1answer
46 views

2D TileMap smooth lighting

I want to implement (a smooth) lighting into my 2D Maps. I want to have the basic idea. What I thought of is 2 components. The Scene's Ambient light: The Tiles and Sprites are tinted into this colour ...
-1
votes
1answer
35 views

Android background music as its own activity?

I know how to play music, but is there a way to play it as its own activity, while still playing the game? I thought it would be somewhat smart since the same music could be played across activities. ...
1
vote
1answer
41 views

How can I calculate when a spesific amount of time has passed

I am trying to get something to happen, when a spesific amount of time has passed(in my case it is in secounds). I have tried using this method: long elapsed = ...
1
vote
0answers
38 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 ...
1
vote
0answers
26 views

Scripting Language for Java and its uses? [duplicate]

So I am going to work on a Java game and recently my friend suggested I use a scripting language to help development go smoother/faster. so far I used XML as data storage and to make the HUD/UI but ...
-1
votes
0answers
55 views

How do I make a 3D object always face the camera?

I'm making a 3D game in OpenGL, and need an object always to point towards the camera. It needs to have the same orientation, no matter what direction it's viewed from. How can I do that?
0
votes
0answers
70 views

Help me solve a problem with my rendering engine (Java + OpenGL) [on hold]

Hey guys I need some help with my game rendering engine from someone with a bit more experience than I currently have as I cannot get my models to load properly. The game is coded in OpenGL and Java ...