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

LWJGL Using wrong openGL version

I am trying to make a game in java using the LibGDX library witch is an extension of LWJGL. LWJGL is claiming that I need at least OpenGL 2.0 with the FBO extension but I only have version 1.1.0. So I ...
3
votes
3answers
110 views

Random numbers with a left or right biased skew

Within Java I have a table of objects ranging from horrible (1%) to wonderful (100%) from which one is randomly selected. This is simple enough and appears on a bell curve with a normal distribution ...
-5
votes
1answer
68 views

How can I make a world? [closed]

I'm making a game, and have the screen done. but now, I want to make a world. But I don't know how to make the world larger than the screen. My screen is 800x600, I want the worldsize about 3x that.
3
votes
1answer
80 views

LibGDX: Is it necessary to set a stage as an input processor when creating a touchpad?

I mean, I've been searching it, they always use set a stage as an input processor after they had added the Touchpadto the Stage because it extends from Actor indireclty(it extends from Widget that ...
0
votes
1answer
38 views

LibGDX: how to implement 2 cameras in a unique stage

I am quite new to LibGDX. I am trying to make a game, where the character is an Actor, and it's controlled by a Touchpad(included in the main Stage as an Actor too). My problem is that I am trying to ...
0
votes
0answers
16 views

Disable buffer swapping in LibGDX

Is there a way to disable buffer swapping in LibGDX every time the "render" call of ApplicationListener returns? I mean - I'm looking on some way to be able to tell the framework if I want the buffers ...
1
vote
1answer
219 views

How Can I Find a Shape on 2D Array?

For the code in my test project, I want to find 2D[,] array shape on the char[][] list. I created an actual map with 'char[][]' array. So, how can I find a tileChar's shape on the worldChar array? ...
0
votes
0answers
72 views

“Choppy” visual of game

I'm using interpolation to move objects on scene smoothly and in same speed. But in reality it looks like they are not moving smoothly - it looks like as game is running at 15 FPS or something like ...
0
votes
0answers
54 views

2D Voxel Game Chunk Question

I'm currently working on a 2D Voxel game. I started with a big blocks array with all blocks inside it, but it is not very good for performance, so I'm currently switching over to chunks. My question ...
0
votes
0answers
11 views

Java keyListener animating bufferedImages

I am making a game similar to a photo scramble/unscramble game which requires the use of keyListeners. I set up the logic but when I code the animations, they just sit there and do nothing and ...
-1
votes
1answer
58 views

Java Move towards point

Ive made this 'game' where you can fire an aibility (a fire ball for instance) from the player towards the mouse (to the point where the mouse was at the time of casting/fireing/shooting the ball), ...
0
votes
1answer
198 views

How to use Java 8 with Lib GDX in IntelliJ?

I have set the jdk to Java 8 and I have modified all the build.gradle files in my project to have sourceCompatibility = 1.8 instead of 1.6. My problem is that while it does work on Desktop it doesn't ...
0
votes
0answers
79 views

libGDX render 2 tiled maps at different coordinates

I am currently learning libGDX and I want to make a game that loads multiple tiled maps and renders them. This is what I have now: public class PlayScreen implements Screen{ private Main game; ...
0
votes
1answer
31 views

How do I ensure proper date formatting? [closed]

I'm trying to load a date in the form of a string. As there is always 4 possible date formats (x.x.xxxx, x.xx.xxxx, xx.x.xxxx, xx.xx.xxxx (day month year)) I had to take this into account and it is ...
0
votes
0answers
71 views

LibGDX Box2DLights - Global Illumination

I'm using LibGDX + Box2D to create dynamic lights in my game, but I'm currently stuck. I'm trying to light up every game object in the game with its own shadow, kinda like global illumination. Do you ...
0
votes
1answer
86 views

Why is the alpha value of a Sprite in LibGdx 0.99607843 and not 1?

I'm developing a game in LibGDX and one of my problems is related to the alpha value of a Sprite object. If I create a new Sprite sprite object then sprite.getColor().a is equal to 0.99607843 and not ...
4
votes
1answer
100 views

Why Canvas is used more than JPanel for making games in Java?

I saw many ludum dare games, which are written in Java ( using it's standart library ), I checked the code of one or two of them and the thing that I saw is in their Game class, they extends Canvas.So ...
0
votes
1answer
106 views

Good Resources for Random World Generation [closed]

Is there a good reference or tutorials available for adding world generation into a 2D game? I've gotten to the point where I have most of the resources available to add world generation but I don't ...
2
votes
1answer
43 views

Slick2D Networking Crash

This is my first post, so I apologize if it's been put in the wrong place or something. Anyways, here's my problem: I've run into an issue with running my client-side code in one of my game-states. ...
0
votes
1answer
47 views

Drawing from an ArrayList drawing same image repeatedly (Slick2D)

This is the game I'm working on. I isolated the problem into this class. public class Runa extends BasicGame { int startTime, tracker; public ArrayList<Circle> circ = new ...
2
votes
1answer
68 views

Java 2D Game Development - Best Performance With Rendering

I have seen two different rendering methods. One of them is rendering multiple bufferedImages like g.drawImage(image1 to imagexxx, x, y). Like in my game I have to render, on each tick, 880 buffered ...
-2
votes
1answer
85 views

My Java game fills the system memory [closed]

edited. I am writing my first game using LIBGDX. The issue I'm having is that the system memory completely fills up and then even the swap file starts to grow. From what I see, the memory fills pretty ...
-1
votes
1answer
34 views

Reading from txt causes null pointer exception [closed]

I'm reading from this text file called beatSheet.txt. A: 100 A: 101 A: 102 A: 103 A: 104 A: 105 A: 117 A: 120 A: 122 A: 126 A: 128 A: 129 A: 130 A: 131 A: 133 A: 138 ...
0
votes
0answers
54 views

Rhythm game timing not accurate enough (CPU workaround?)

I had an idea that I would 'play' my rhythm game first and have the times at which I hit the key output to the console, so I could use those values minus the hard coded in time it takes an object to ...
-1
votes
1answer
82 views

How would I implement a realistic stock market?

I'm making a corporation simulator, and it contains stocks. In the game you can buy and sell stocks, but I can't implement a realistic change in the price for them. How do I make them change up/down ...
0
votes
1answer
105 views

Raycasting. Corner trap

In my top-down game character moves to target (pathfinding) also avoiding obstacles with Raycasting(Central ray with whiskers), but situation like on picture causes shiver and unneeded turning ...
0
votes
0answers
26 views

Java Rectangle Collision Glitch

I have a platformer type game where I have a level builder(reads a .png file and converts into a level where there are rectangle boxes). I have rectangle collision on the boxes but when I make my ...
3
votes
3answers
198 views

Using two languages in a game engine?

I'm thinking about making a game engine as a learning project. I know Java the best and I figure most of the code is not going to be running that much of the time, (20/80 rule) so why not write most ...
0
votes
0answers
38 views

Problem with Collision Detection

So I am adding collision detection into my game but whenever I start the game I get a rendering crash saying that there is a 'Game.update() failure - check the game code.' I have repeatedly tried to ...
-2
votes
1answer
46 views

how to set in vector float x y coordinates [closed]

i am use eclipse java android i am try to projectile trajectory in my game like angry birds example here ...
0
votes
0answers
43 views

How to pass a java string variable from android activity to unity3d C# script variable?

Require some help to pass custom autogenerated text from android activity to unity3d activity being started.
0
votes
1answer
49 views

My game has messed up layouts!

Earlier, I asked this question: Landscape mode for game? Where I had a directory for each and every layout, but the layout in the layout-land directory wasn't showing up when positioning my layout in ...
1
vote
1answer
36 views

Error When Loading a .tmx TILED map through the TiledMap class

So I made a map using the TILED application and I have it as a .tmx for reasons, but whenever I use the TildMap class in the Slick2D library to render the map on the screen, it gives me an error. Here ...
6
votes
1answer
126 views

Minimum number of moves algorithm in Java

I'm looking to implement the minimum number of moves algorithm for the java game I'm developing but I can't quite figure it out. Here's an example picture: There are also some specifications ...
0
votes
1answer
75 views

Is It Better To Generate A Pre-Generated Map or A Randomly Generated Map When Using Tile Properties? [closed]

So I am contemplating whether or not to add a Pre-Generated Map or a randomly generated map into my game. But I also need to add Tile properties into the map (i.e. so that water tiles aren't being ...
2
votes
1answer
38 views

Use an int as a reference to a specific class

So I'm trying to make an efficient game where there is a grid system and every grid has a number that is able to identify what kind of block is located there. This lets me just have an array of ...
0
votes
1answer
61 views

Positioning partials of character sprite animations

I'm not entirely sure how to best explain what I'm doing. Maybe I'm going about this completely the wrong way. If any of you find that that is in fact the case, I would appreciate it if you told me ...
4
votes
1answer
108 views

How do I do selective water surface rendering?

I have a shader that renders the "texture" of a very realistic water on a tile in the 3D world using a Frame Buffer. The problem is that, for example, I only want to render the part that isn't below ...
0
votes
0answers
79 views

Landscape mode for game?

TL;DR: I have made 8 new layouts for each activity layout, but they are not showing up. For example, I have a layout-land directory with a layout, but that layout doesn't show up when I turn my phone ...
1
vote
2answers
123 views

How to make a “Camera” in Java

I need some help with getting my camera to work in java for a game that I am making. The problem is is that I've never made a camera in a game before and this is my first time trying to make one in a ...
0
votes
1answer
65 views

FollowPath steering behavior

I'm having a problem with AI movement in my top-down game. AI builds path and than moves using libgdx FollowPath (this problem is still actual) steering behavior. I have some solutions, but can't ...
-1
votes
1answer
44 views

LibGDX - Map Boundaries

Synopsis Well, I'm making a little top-down JRPG and today I was like 'Yeah, I'm gonna bust out this whole map collision thing!'. I failed. Problem So I went on the internet and looked up 'LibGDX ...
0
votes
1answer
109 views

Java - LWJGL OBJ Loader with Materials not rendering

So I successfully loading my obj file but I obviously want to get materials on it. I added the vt(texture) to the OBJLoader and the Model.render but still rendering textureless. I have exported the ...
0
votes
0answers
27 views

Libgdx Box2D - Object not showing up

I am trying to put a sprite into my b2d-world. But for some reason, it is not showing up. I've already checked the camera settings, they are defenetly correct. Then I came to the point to check the ...
3
votes
1answer
125 views

Resolving collisions with float precision errors

I'm facing a problem when I try to resolve the collision between two units using floats as positions of the units in my game. I am detecting the collisions using the SweptAABB algorithm and if there ...
2
votes
2answers
40 views

How can I automatically fit elements in libGDX layouts?

Recently I wanted to use libGDX's Table to show four buttons. But my table doesn't fit on the stage: Here is the code I used: table.add(new GameButton("1")); table.add(new GameButton("2")); ...
0
votes
0answers
9 views

What is vector<E> how to use in android java [duplicate]

I making game i want use vector into velocity,position and rotation. But i don't know how to wark vector so please help. Thank you
3
votes
1answer
105 views

VBO rendering crashed with glDrawArrays

I'm playing around in LWJGL3 and I'm experiencing an issue regarding glDrawArrays. At glDrawArrays the JVM crashes. I'm using modern OpenGL and therefore I have my own shaders and matrix ...
2
votes
0answers
50 views

Fixed timestep periodical “lags”

I have fixed timestep code in my main thread, it looks like this: float oldTimeSinceStart = 0; float accumulatedTime = 0; float maxDeltaTime = 0.1f; // 10 FPS float fixedTime = 0.016f; // 60 FPS ...
1
vote
1answer
137 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 ...