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.
-2
votes
0answers
38 views
How much memory consumption is considered acceptable for an Android game? [on hold]
I'm making a game for Android using LibGDX in Android Studio. In my game I use the AssetManager and I've splitted the resources into 2 sections: Menu and In-Game. Whenever the player moves from a menu ...
0
votes
0answers
14 views
Question about parameters of `Matrix.orthoM`
When creating an orthographic matrix using Matrix.orthoM should the bottom/top always be such that bottom < top ? (*)
(Similarly for left / right and near / far, except that near and far should ...
3
votes
1answer
33 views
Can you compare a parameter to another parameter using ChoiceFormat?
I'm currently using the I18NBundle (wiki | docs) package from LibGDX to do some internationalization for my game. the I18NBundle internally uses the java MessageFormat (docs) to format strings such ...
0
votes
0answers
21 views
Some problems with drawing textures by JOGL and shaders compilation
I copied and pasted this code:
package test;
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
import glsl.GLSLProgramObject;
import com....
0
votes
1answer
49 views
When I drag a JLabel, why is it appearing in a different location?
I am making a checkers game, and it is behaving very strangely. As of now, I am just trying to get the basics, such as grid layout, and getting the pieces laid out and moveable. My 8 by 8 grid opens ...
1
vote
0answers
14 views
Font loads with artifacts
I've recently come on to an error when loading fonts in my game, some letters show up perfect while others have artifacts around them. Here's an example of this:
While some letters are perfectly ...
-2
votes
0answers
25 views
How to install opengl for notepad++ [closed]
I have notepad++ on windows 10. How would I install OpenGL on it for java?
0
votes
1answer
26 views
Draw multiple times same object but translated and rotated
I want to draw lots of spheres in different locations and orientations with Opengl4 and JOGL. As the vertexes and colours are the same for all of them, I have just one array for vertexes and another ...
0
votes
0answers
48 views
Optimization memory I/O. Draw and colour only vertexes
I want to display in OpenGL all vertexes of a box that is made by x, y and z vertexes, all along the X, Y, Z axis respectively. All vertexes must have a solid colour but won't be the same as the ...
-1
votes
0answers
29 views
Java - 2D Puzzle Platformer [closed]
I'm planning on creating a 2D puzzle platformer in Java and was wondering what would be the best framework/libraries/engine to use. This will be my first game so general advice is appreciated. I have ...
1
vote
2answers
33 views
Dynamic chunk loading with high FPS. But still chops
I am creating a voxel world, (like any other person), but I currently have a small performance hit when loading/unloading chunks.
Right now I can load and unload chunks dynamically with "infinite" ...
0
votes
1answer
102 views
Can this singleton class cause a memory leak?
In a game I'm writing using LibGdx, I'm wondering if a memory leak will occur on Android when the home key is pressed or a phone call gets received and the game gets put into pause.
I have a ...
1
vote
1answer
37 views
How to run JarSplice from the command line?
I've tried java -jar jarsplice.jar --help and "" /? which just launches the UI. I'd like my game to automatically be packaged into a single jar when it's built so it would be very useful to be able to ...
1
vote
0answers
33 views
How can I draw textures with JOGL?
I have begun to learn OpenGl and using JOGL. There's something I haven't found any actual or easy guide to though: how can I draw textures? For example, what kind of code would I need to draw a ...
3
votes
1answer
91 views
Drawing a graph in Java JPEG/PNG for a simple map
For my game i need to create a map based on a graph starting from the coordinates of the nodes, using "roads" instead of simple lines (for the edges) and circles instead of points (for nodes), but i ...
1
vote
0answers
35 views
How do I deform a texture?
I'm using LibGDX, and I don't know where to start; I would like to deform a texture.
Let's say I have a PolygonSprite, and I have vertices and a texture.
Image 1 represents what I have. I would like ...
-1
votes
0answers
27 views
LWJGL projection not working
I set up a orthographic projection for a game, but it just makes the screen black whenever I add .. projection * ... I've tried different ortho formulas but I get the same result. I've tried ...
0
votes
3answers
75 views
Game search engine in a p2p format
I am currently using Java to develop a multiplayer game engine. However, I am stuck on one thing. Many games (Overwatch, DotA) have automatic game search engines - you click a button and the computer ...
0
votes
0answers
30 views
Design convention for modular game object, Java
I want to implement a weapon object such that it would be very modular (Fallout/Borderlands like). Also assume that certain weapon extensions can cause manipulate the weapon's basic stats upon every ...
0
votes
1answer
26 views
Autoscroll a TextArea to youngest/freshest row/line
I want to use a TextArea UI widget as a UI integrated Logger.
Therefore the TextArea should always show the youngest message.
I browsed the whole API to find the proper method but could not find any.
...
0
votes
0answers
14 views
Placing nodes according to texture size with walls
I implemented a* pathfinding in my game. I have a grid of 32x32 pixels and that's also my tile size. I'd like all my enemies to be a free size of pixels. Now, this is what happens when I run my ...
0
votes
0answers
22 views
Storing game objects for use in Callback
I am currently storing my game objects and textures in the main game class and I was wondering if there was a better way to store them to be able to use them with a addon loading system that I made.
...
0
votes
1answer
32 views
LIBGDX - How do I change the loaded file by the TmxMapLoader from class that extends from the playscreen screen?
So I was following this guy's tutorial on how to create the Super Mario Bros game, and I was wondering how it would be possible to change levels (screens), in the tutorial he creates a PlayScreen, I ...
1
vote
0answers
42 views
Node.js in LibGDX project [closed]
I'm developing a game with LibGDX, and right now I'm trying the multiplayer part. I have managed to connect several players through Node.js and socketIO but when I try to make the lobby I am doubting ...
0
votes
0answers
21 views
Compatibility between Jogl and Jwjgl
3 years ago, I was developing a software in Java with Jogamp Jogl OpenGL bindings.
Now, I consider using Jwjgl as OpenGL bindings. I don't know if there is a compatibility between the two libraries. ...
0
votes
0answers
31 views
Can't run LibGDX test and demos
For some reason I've failing running LibGDX tests.
I do everything exactly as the tutorial says: https://github.com/libgdx/libgdx/wiki/Running-demos-%26-tests
Still I get all these errors.
Please, ...
0
votes
1answer
24 views
LibGdx, conflicting UI button clicks and screen touch events
My game's main game class is a Screen which also implements InputProcessor to handle touch events.
The screen renders a TMX map using an HexagonalMapRenderer and a Camera, like this:
_camera = new ...
1
vote
1answer
77 views
Game logic in mvc: model or controller?
Sorry if the title is too broad, I'll try to explain this in a more specific way down here.
We need to create a board-game in Java for an University project and we have to use the mvc pattern for it.
...
1
vote
1answer
37 views
LibGDX Bomberman bomb arraylist iterator error
Here is the code of bomb:
private int x, y;
private Texture bTexture;
private boolean bomb_explode;
private Timer timer;
private TimerTask task;
private int timeLeft = 0;
private TileMap map;
...
0
votes
1answer
36 views
Implementing a resource bar with LibGdx
I am developing my first LibGdx game, and I would like some help understanding Scene2D/Ui.
So far I understand a "Stage" contains the various UI elements, and a "Table" contains the layout; an input ...
1
vote
1answer
64 views
Frustum Culling Plane Issue
I have been having an issue with frustum culling, specifically culling planes (not to be confused with the frustum planes). I am using JOML in Java with the FrustumIntersection class, and using the ...
1
vote
2answers
44 views
Bouncing off edge in libGDX doesn't work after resizing window
I have a game in which the enemy has to bounce of the edge, when it hits it. It is working fine, normally, but when I resize the window, the bouncing breaks. It doesn't bounce properly.
In the image, ...
0
votes
1answer
50 views
Java - simultaneous ground and wall collision
I've been working on a Line2D based collision system:
public void update() {
for (int i = 0; i < lines.size(); i++) {
line = lines.get(i);
if (line.line.intersects(player....
0
votes
1answer
27 views
Why does my libGDX TextureRegion.split code not work properly?
I am using scene2d in libGDX on Android as part of a game I am working on. I have a simple splash screen, which I am trying to display a single image on. The image comes from a file with two tiles in ...
1
vote
1answer
66 views
How to make this generated terrain flat-shaded?
I'm generating a relatively low-poly terrain for my game using the code below:
for (int z = 0; z < VERTEX_COUNT; z++) {
for (int x = 0; x < VERTEX_COUNT; x++) {
final float posX = x ...
-1
votes
1answer
95 views
In Final Fantasy VII, how are primary stats calculated upon level up? [closed]
I'm creating a stat level up calculator for Final Fantasy VII, and was reading through a guide.
For leveling up on primary stats, it says "This difference is then capped at 0 to 11 inclusive", ...
1
vote
1answer
112 views
How to draw smooth moving curve in libgdx?
i need to draw curve like this picture, I have tried from this link https://github.com/libgdx/libgdx/wiki/Path-interface-&-Splines , but the curve is not so smooth like some game(Amazing Wire) ...
0
votes
0answers
41 views
How could I set my player in the center of my camera without hardcoding?
I'm developing a simple 2D game where you control a line or a "smoke" trail.
I have a Camera class that calculates it's x and y in the tick method.
I want to have the camera initially spawn dead ...
0
votes
1answer
50 views
Creating and editing a .fnt file
I am currently making a game, (obviously), with the LIBGDX Java Library. I have already made a font, (It's a PNG file, not a TTF or RTF), that looks something like this:
(It's a mockup, by the way.)
...
1
vote
2answers
118 views
Java - Why does my game loop stutter randomly?
I'm a beginning game developer and I'm trying to make a game in Java, but for some reason, it keeps stuttering at random times. I believe what I'm experiencing could also be called microstuttering.
...
0
votes
0answers
89 views
Java Game - How to store and instantiate objects
I am starting a simple console RPG game, just for practice. I managed to write a nice turn-based battle system, with sample objects instantiated only for testing. Now, for example, I have a Weapon ...
0
votes
1answer
95 views
Is this a good Java gameloop?
I wonder if this gameloop in Java is accurate to give around 60 frames a second, is it?
public void run() {
long then = System.nanoTime();
long targetFPS = 60;
Timer timer = new Timer();
...
0
votes
1answer
26 views
rotating a sprite around a non-fixed center
I'm trying to get this character to spin in a circle to aim at the cursor. It all works pretty well, but I can't get the image to rotate around its center. Only around its corner. I've been trying to ...
0
votes
0answers
22 views
Problem in jump mechanics in Libgdx
I have a Player class below :
package com.gitlab.runner.tiger;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.g2d.*;
import com.badlogic.gdx.graphics.glutils.ShaderProgram;
import com....
0
votes
2answers
71 views
Java - Declaring a random Vector affects a Vector in another class?
I'm working on a 2D game and I've come across something strange which I've been working to fix the whole day but can't.
I'm trying to make an arrow fly, but modifying it's class affects my Player ...
0
votes
1answer
52 views
How to use a DualShock 4 controller in Java?
I want to use a DualShock 4 controller in a computer program I'm developing.
Do I only need to use a library? Or do I need some other things too?
I don't have any code yet, I'm just starting to look ...
0
votes
1answer
49 views
Problem in bounding box collision detection in libGDX
I have a Background class containing 5 layers, I've created a collision box for 5th layer. Here is the code for my Background class:
package com.gitlab.runner.tiger;
import com.badlogic.gdx.Game;
...
2
votes
1answer
39 views
Collision detection with Java streams and access of collisionable objects
I'm trying to learn some things about collision detection, and I've never known how to cleanly detect this for multiple objects in multiple classes without just copy pasting a lot of code.
I now came ...
1
vote
1answer
101 views
Why does my Java game loop randomly jump to 62 FPS and crash?
I've been working on a Java game, but I couldn't keep it from stuttering. I did some research, and found out that I was using a bad game loop. I've been working on a new game loop, which works a ...
0
votes
0answers
56 views
Character Sprite Not Rendering Correctly in LibGDX
I'm new to libGDX, so I'm a n00b to this community, so any help is greatly appreciated!
Currently, I am making an RPG with the hero being moveable by the arrow keys. In addition, there are enemies ...