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

How to make “Events”/ Scripted Scenes

I want to make cutscenes etc, in my game. I thought of a similar System like in the RPG Maker: If you enter a certain Area, a list of commands and arguments is played. E.g. like this: [Move ...
0
votes
0answers
29 views

Java GUI Development: Learn Using IDE or Pen and Paper? [on hold]

I am currently working on a game in Java. It has many of the basic features and is playable, but it does not have any graphics (you play it in the command prompt). I want to learn GUI programming ...
-2
votes
1answer
20 views

single Key press

I have my following (static) KeyListener http://pastebin.com/gR1i3Xzb and this is my update Method: @Override public void update() { input(); /*...*/ } private void input() { ...
1
vote
0answers
43 views

Blinn-Phong lighting on Voxel models

I'm creating a game that is going to use voxel models. However I got stuck when I coded my shader using Blinn-Phong algoritm. Here is how it look (Only care about the red model): As you can see ...
-1
votes
1answer
30 views

Drag and drop game for android

I'm trying to make some alert for my drag and drop game which I want to insert the sound when user drag the right answer in the space provided. How can I code my Java in Eclipse? Someone please help ...
2
votes
1answer
26 views

How can I repeat a Texture Region in libGDX

I have a texture that is part of a sprite sheet. I want draw the texture to cover a certain length, but I want it to repeat not stretch. However,when I use the following code batch.draw(hillBottom, ...
4
votes
1answer
152 views

LibGDX input y-axis flipped

I'm writing a game in Java for Android using LibGDX, and I connected my phone so I can test it on it. I know that LibGDX's render system works different than regular Java systems since the 0,0 ...
0
votes
0answers
15 views

Filling the viewport area of a orthographic camera with an image (libgdx)

So im trying to get the whole area of the viewport and then use the coordinates to draw images in the camera's viewport. So if the camera moves I can fill it with one image the length and the width of ...
0
votes
1answer
85 views

What is the correct approach to implement multiplayer in a game? [duplicate]

I'm developing a game and it is intended to be a multiplayer game. I have experience in writing servers and clients in Java, but the game is written in C++. The server will be written in Java for ...
0
votes
0answers
26 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 ...
0
votes
1answer
23 views

Move a box2d body towards mouse [on hold]

I'm using LibGdx's Box2D in Java. I'm trying to apply a force to the body that would send it towards the mouse. The problem is, I'm having trouble figuring out a way to send it directly to the mouse ...
1
vote
1answer
51 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
32 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
128 views

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

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
93 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
15 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
1answer
37 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
36 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
56 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
24 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
27 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
42 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
79 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
127 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
41 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 ...
0
votes
1answer
66 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
34 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
53 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
39 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
21 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 ...
0
votes
0answers
27 views

Kryonet with multiple clients overhead server, how to deal with this? [on hold]

I'm developing a server-client multiplayer game using Kryonet and libGDX. My server contains 100 entities and sends updates at 20 packets per second to clients using udp. Each packet contains the 100 ...
1
vote
2answers
67 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
71 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
45 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
37 views

Java XML file data mangment. sorting by multiple tags [on hold]

So lets say I have this xml file. <Building> <firstfloor> <biome_urban id="1001"> <dosomthing></dosomthing> </biome_urban> ...
0
votes
0answers
32 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
30 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
72 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
49 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
157 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
53 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 ...
1
vote
1answer
45 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
43 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
50 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
38 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
77 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
27 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
63 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
11 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
64 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 ...