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

Issue with texture mapping on a spehre using opgengl es 2.0

I have a problem to calculate the right UV coordinates. I'm calculating the sphere by subdivate a ocathdron. What did I do wrong? Calculate UV Points for the texture: private ...
2
votes
1answer
65 views

Using world coordinates instead of pixels

I've been told that having a set pixels-per-world unit number is bad practice because it will not look the same at different resolutions. Because of this, I am trying to learn about using abstract ...
1
vote
1answer
41 views

LWJGL: loading textures of various types

I googled around a bit and nobody seems to have asked this question. I have images in multiple color formats (all of them are PNGs). Most of them are ARGB but my bitmap fonts are gray scale, and I ...
3
votes
1answer
187 views

How can I make a self-updating game launcher? [closed]

I have been creating a game with java, and before I release it I wanted to make a launcher that is connected to the game's website. Basically I need to make a launcher that updates itself when I have ...
0
votes
1answer
110 views

How to only render whats on screen (Tilemap, Java2D)

I have some problems with my rendering of a 2Dimensional Map. for (int col = 0; col <= view.getWidth () / Tile.TILE_SIZE; col ++) { for (int row = 0; row <= view.getHeight () / ...
0
votes
1answer
43 views

How can I use OpenType Font in libGDX

Is there a way I can use an OTF file with libGDX. The following throws an exception: gameFont = new BitmapFont(Gdx.files.internal("data/font.otf")); Caused by: ...
0
votes
2answers
74 views

Libgdx - How to rotate a single ShapeRenderer object

So, looked at a couple of questions similar to this, led me straight into dead ends. I have an object drawn out in ShapeRenderer, and I wish to rotate only that one object. I have tried ...
1
vote
1answer
42 views

Certain random content rendering differently

On the main menu of my game there is (obviously) several buttons. 2 of which, in different positions on different screens, render a different colour to the rest. As you can see below, "New game" ...
2
votes
1answer
74 views

(Minecraft) MoveHelper for custom entity not updating

I'm trying to create a shark mob for minecraft 1.8 (using Forge 1.8). Since it's a water mob, the movement functions need to be edited to allow it to path correctly in water. However, after ...
0
votes
1answer
40 views

LibGDX - how to detect touchUp with GestureListener?

I'm making a game and I have implemented GestureListener as my inputprocessor. It came with a bunch of methods such as fling, pan, tap etc etc including touchDown. However, there is no touchUp method! ...
1
vote
1answer
39 views

Java - Trouble with recursion and rectangle placement

I am using Android API's and using the RectF class for rectangles. I have a list of blocks that are on the screen at one time. Each block is given a random position, and then I go through all of the ...
0
votes
1answer
49 views

How to fetch unit coordinates for AI?

I have been designing a simple turn based Civ-like game over the last two days with libGDX to test myself. I have a units class that can be extended to make unit types and I have my game board set ...
0
votes
1answer
88 views

Using Java on mobile, should I avoid object construction to reduce GC overhead?

I new to both Java and game development and working on my first LibGDX game targeting mobile systems. How problematic is the garbage collector in a mobile environment? Should I try to reuse as many ...
2
votes
2answers
179 views

Efficient removal and adding of Components in ECS

i'm working with the Ashley Entity-Component-System (related to libGDX) to program a server-side simulation for an online game and i stumbled upon a serious performance drawback, that is probably ...
1
vote
1answer
43 views

How can I rotate a quad around it's center?

My code is: GL11.glPushMatrix(); // rotate around center GL11.glTranslatef(-200/2, -200/2, 0); GL11.glRotatef(30, 0.0f, 0.0f, 1); GL11.glTranslatef(200/2, 200/2, 0); // draw quad ...
1
vote
1answer
80 views

How can I blend up to 3 textures on a polygon without blend maps?

For my voxel game I need to blend up to 3 textures in the same polygon. It would be preferable if I could specify a texture id for each vertex, but other solutions are accepted as well. Here's an ...
0
votes
1answer
70 views

Camera.unproject(Vector3) method is not working in libGdx

I know the touch postioning in libGdx uses OpenGL, making 0,0 the bottom left corner while the camera uses the top left corner as 0,0. I did some searching and found this SO question that specifies ...
0
votes
2answers
112 views

How to create a Update function in Java

I have recently started using Java, but have been programming in javascript, and actionscript 3 for a while. I am used to the language giving me the ability to simply do something like: private ...
0
votes
0answers
44 views

how to move an object to the mouse in Java

I have just recently started using Java, literally 2 days ago, and I have run into an issue. While I have been easily able to figure out most of the syntax and methods, because I have used multiple ...
0
votes
0answers
58 views

How to draw my android Hexagons in a grid?

I am trying to create a hexagon grid using the Android ’Canvas’ package. I have a working ’Hexagon’ class that when used in a view will draw a single hexagon on screen. The problem is that I need many ...
1
vote
2answers
116 views

LibGDX - Rendering things in different classes

thanks for your time! I'm really new to LibGDX (and Java itself). Which approach should I use to render my different game parts? I want to show a background, the main character, a bunch of enemies ...
1
vote
0answers
98 views

2D Parallax Scrolling

I'm trying to implement parallax scrolling and have a partially working equation (from a book I've read) but it doesn't fully align to the screen. I also want to stick purely to integer maths. I've ...
0
votes
0answers
64 views

KryoNet/Multiplayer Basic Design Questions

I am building a simple turn-based multiplayer Android game that resembles chess a bit. I'm using KryoNet for the multiplayer. The only thing I got working so far is the login server and game ...
0
votes
0answers
47 views

Vertex Skinning OpenGex Incorrect Transformations

I'm following the formula here, I'm using LJWGL, OpenGl, OpenGex, and Blender: I implemented the code and it works but there is a few things. First, there is a gap between the two bones, or on each ...
0
votes
1answer
52 views

Java: Exported JAR file doesn't load images

I am using Netbeans to create my game. The images do seem to load when I run it in Netbeans. However, the built jar file only leaves me with a blank screen. This is how I call the images in my game. ...
-2
votes
2answers
93 views

Multithreaded or Thread pooled server for real time multiplayer games? [closed]

So if the Thread pool handles 10 players out of 100 per second, this could make a delay that will be no good for real-time games, so as I see it that MultiThreaded will be better, thus it will handle ...
-1
votes
1answer
56 views

What is the best way to send/receive data about user coordinates and other properties?

For example If I have 2 users, and each of them have an object, and that object has: x coordinates, y coordinates, angle, state, and other properties... I use java let'say the game changes at 30 ...
2
votes
2answers
166 views

Unknown length of primitive array

For my Voxel like game I need to generate terrain meshes from an array of ids. Because of that I have no idea how big the final vertex array will be. Currently I'm doing like this: generate mesh and ...
2
votes
1answer
59 views

Java: Problems with Tile Collisions

I have created a tiled map using a BufferedImage (img) from a PNG. From that, I would like to detect the player's (peter) collisions with individual tiles on the map. However, my code will not run and ...
2
votes
1answer
78 views

Best way to deal with Collision in JavaFX

This question I'ts no exactly a fix for the current game I'm working on, but I am showing it as an example to explain my problem. I just want to know the best way to handle collision in JavaFX. My ...
-2
votes
1answer
48 views

Libgdx Statebased game not working

I'm using Libgdx and I wanted to change the default application to a Game with multiple screens. I get an odd nullpointer that has to do with the engine. I'll show you my little setup code. Here I ...
0
votes
1answer
53 views

Sending an object from one point to another

I am working on a simple game in Java and am stuck for now with getting an object to be directed from its current position to a certain point, all at a fixed speed. My problem is that whenever I ...
0
votes
0answers
66 views

Android client-server logic for a multi-player game

I'm creating an android "quiz" app. The game can be played by two user in real-time. I'm creating game on server with this design: //node js server //new game request api @game/request/new var ...
2
votes
1answer
148 views

Creating a Melee Weapon in Box2D (libGDX)

I am struggling with how to implement a melee weapon that can swing when a key is pressed. I am imagining two different attacks (stab and swing) I have tried creating two fixtures (character + ...
0
votes
0answers
36 views

How can I render several rectangles efficiently? (LWJGL)

I'm working with OpenGL3+ rendering and I am coming from OpenGL1.5. In GL1.5 I had rendered things like this: public class GraphicsDead { int vboVertexHandle; int vboColorHandle; public ...
0
votes
0answers
65 views

Problems with starting a new game in Tic-tac-toe

I have problems with a new-game method in the game Tic-tac-toe, because after I play a game against the computer, and want to replay the game, the buttons freeze and I can't press them. For playing ...
0
votes
0answers
12 views

Problems with computermove in tctactoe android java

I have problems with the computerMove in tictactoe. I am trying to do a method with matrix, but I do not know how to do it in a good way. I have done an array with button which the game board will be, ...
1
vote
1answer
87 views

Server networking - Thread per player

As my game is purely multiplayer, online performance is important. Should I run two threads for each player/connection? (One for input and one for output) or should I run one thread for all player ...
1
vote
1answer
111 views

Libgdx understanding screen size

I'm trying to create my own jumper type game where the player moves up through an infinite y value. The problem I am having is getting the screen size to match up with the android screen. viewport ...
1
vote
0answers
48 views

Game state: getting it to work help! [closed]

I've started using enum in java but I ran into issues getting it to work, how would i be able to make it start of with a Intro going into a main menu (with mainmenu backround and buttons) and you can ...
1
vote
2answers
230 views

What makes Minecraft so CPU intensive, and what could be done to improve it? [closed]

Recently I've been searching for VPSes that allow Minecraft servers to be hosted, and surprisingly very few do. Most allow for games - but Minecraft in specific is disallowed by many. Now it's fairly ...
1
vote
1answer
53 views

Drawing text with Slick

I've been trying to draw a text to the display using Slick. However, when ever I draw the TrueTypeFont to the screen, it draws it reversed upside down and also, it makes the whole display turn black. ...
0
votes
0answers
60 views

OpenGL camera scrolling too fast

I'm using the code from this tutorial but in Java and LWJGL. The problem is I want the player to click and drag around the world with the mouse. I tried adding the mouse dx (velocity) to the camera ...
0
votes
0answers
29 views

How to Move Image Based on Rotation Java Slick2D?

I am trying to rotate image based on rotation. I am unable to do so. Here is my code Vector2f direction = new Vector2f((float)Math.cos(Math.abs(imgIcon.getRotation()) - anglecorrection), ...
0
votes
0answers
36 views

Detect which direction an object collides with another

so I am trying to implement a collision detection system. I'm only using rectangles, so it's not too complicated. My collision detection currently does detect if the 'player' object intersects the ...
0
votes
0answers
309 views

Libgdx Music error QCMediaPlayer mediaplayer NOT present

Problem solved with music = Gdx.audio.newMusic(Gdx.files.internal("song.mp3")); I am looking for music implementation in my app with LibGDX. I saw the guide provided in LibGDX documentation but it ...
1
vote
2answers
190 views

Load a simple text file through asset manager in libgdx

It's easy to load a simple text file from the internal: Gdx.files.internal("data/colors.txt"); But I currently use an AssetManager to load assets that are defined in an array of ...
3
votes
1answer
108 views

Endless Running Game - Changing Lane Function in JAVA

I am developing a kind of vertical endless running game, where the character has 4 possible lanes to be in. I am using libGDX and want the character to change lanes by adding a horizontal velocity to ...
4
votes
1answer
756 views

BitmapFont - where is getBounds method in new 1.6 libGDX

I download newest libgdx version 1.6 and i cant solve problem with center my BitmapFont text. Earlier in version 1.54 i used getBounds() method to find out width of text. Share your solutions, thanks ...
1
vote
2answers
104 views

Tilesets - how to make the pink color appear transparent

recently I searched for some free to use Tilesets on the internet. And wherever I found a sheet of sprites there is this pink color in the background. i know that all the spots having that color ...