Java is both a popular programming language and runtime environment which allows Java programs to run unchanged on most hardware and software platforms.

learn more… | top users | synonyms

2
votes
0answers
14 views

LibGDX's HTML project doesn't show anything in Browser

The question is self explanatory, when I run my demo-html project as a Web Application and I open Chrome with the provided link by eclipse, my browser doesn't show the image it is supposed to show in ...
0
votes
0answers
57 views

LibGdx - How can I correctly handle tile transitions / connected textures?

So I am making a tiled game and I need to connect textures correctly based on whats next to it. With tiles that had connection really close to the edge of the tile I could just use the 4 bit meathod ...
0
votes
0answers
19 views

How to draw square composed of four triangles ? ( libgdx )

I've a case in which I need to draw square composed of four triangles like in the photo bellow : The triangles parameters are stored in the JDBC , I know how to draw shapes in Lbgdx but this kind ...
0
votes
0answers
66 views

Java vs C++ - How much worse is Java than C++ performance wise [on hold]

I want to create my first game. I'm quite good at Java, but I know it have poor performance. But how poor? Sometimes I see people who call it terrible compared to C++. Is that true? A little case: ...
0
votes
0answers
16 views

how to use texture maps in shaded terrain

I'm learning how to use height maps and alpha maps in the JMonkey Engine, and when I try to use a shaded material in my terrain, I get an error saying the Alpha parameter is not defined. I tried to ...
0
votes
1answer
22 views

Resultant Vector Of Circle Line Collision

For my game I need to have a circle collide against a wall and bounce off in the appropriate direction. I've looked around for a while and haven't found a good solution to my problem. I have a diagram ...
-3
votes
0answers
17 views

Eclipse is there a way to give a logo to my runnable jar [on hold]

Is there anyway i can give me game a logo
0
votes
0answers
19 views

Entitiy spawn on Button press

I'm trying to create a little 2D-Zombie-Shoot game. I'm pretty much at the beginning of programming. At least, I can create a player that is moving with arrow keys and stuff. My question is: How do I ...
0
votes
0answers
45 views
+50

How do I manually create a .atlas file?

I am trying to learn Andengine, and it seems it does not support sprites in any other way other thab a Texture Atlas. I am using the Android AIDE app and importing the older Andengine .JAR because I ...
-5
votes
0answers
14 views

Backgammon Programming In Android OS [on hold]

I have a school project which is programming backgammon game in android os . Can you give me a roadmap ? Also i search in web but i can not find any sample code or lesson. Thank you.
1
vote
2answers
55 views

Making an organized rendering class

I'm using LWJGL (opeengl wrapper for Java) and Don't know how to make a renderer class for OpenGL. So In Immediate mode rendering I'd do a method like this to draw quadralaterals. public static void ...
1
vote
0answers
43 views

Life Counter in Greenfoot caught “Incompatible Types” exception

I need to make a life counter so that when my Actor get hit by an Enemy, his life will be decreased by 1. I put this method in my Actor class: private void decreaseLife() { Actor enemy = ...
2
votes
1answer
103 views

Should UI be part of the game-loop?

I can't really find a good answer to this anywhere, I have never worked on games in a proffessional environment and I am wondering; Do these games render their UI in the main game-loop? That is, do ...
0
votes
0answers
21 views

Projectile following camera

I watched this tutorial on how to create a camera in Java: https://www.youtube.com/watch?v=TlleDQFlTxA The camera works perfectly but the bullets keep following the camera. I've been trying to fix ...
0
votes
0answers
32 views

How to get GestureDetector to work?(Problem with GestureDetector class)

I am trying to write simple program which would get input from user by swiping in four capital directions. I'm extending GestureDetector.java from libGDX and overriding fling method, but no matter ...
0
votes
0answers
14 views

LIBGdx - Kryonet with an InetSocketAdresse

I'm trying to implement Kryonet in my game and i'm facing some trouble. Using the source from the code i develop my server like that : try { this.server = new Server(); ...
0
votes
2answers
61 views

How would I create classes for each map tile instead of using a tmx? LibGdx

I am making a top down style game using LibGdx that I want to be randomly generated each new game load. I already have the algorithm to generate the array for what tile should be what. But i'm ...
0
votes
0answers
64 views

Create game using trees [closed]

I need to create a game in java that uses game trees. I need to make something simple and I'm looking at ideas such as the NIM game which would use a tree and without having to do too much coding on ...
0
votes
0answers
40 views

Should I handle mobile collision from the mob or projectile?

I have a fast tile collision setup and quadtrees for collision between mobile entities. I have been back and forth in my other games for if I handle projectile-mob collisions in player or mob ...
0
votes
2answers
55 views

Java libgdx Game Screens and rendering tile map [closed]

I'm working on a 2D tiled game with Java and libGDX. I'm having problems implementing gamescreens. I'm trying to set the screen to gameScreen and start rendering tiles, but I'm getting a nullpointer ...
0
votes
0answers
41 views

Reading an integer from an object input stream in JavaFX [closed]

I am trying to create a simple networked game, right now the object is to get squares moving around and able to see the other square move in real-time over a TCP network in JavaFX. My main issue seems ...
0
votes
0answers
22 views

Sprite animation in Java? [duplicate]

I know this question has been asked many times but none of the answers were very clear to me. I'm working on a small Java RPG, and so far I can control a character (drawn onscreen with a .PNG sprite) ...
-1
votes
0answers
14 views

Errors with draw two images

I want to draw two images, but java create only one, please help. public class Game{ public static void main(String[] args){ JFrame frame = new JFrame(); Player player = new Player(); ...
-1
votes
1answer
24 views

How to make object to stop moving

I'am making the game in Java, and I'am make the object, and she move, but i don't know how to make it stop. public class Player extends JPanel implements ActionListener, KeyListener{ // Varibles ...
0
votes
0answers
16 views

LWJGL Using .setIntialBackground and Drawing Textures?

I have been trying to create a game with LWJGL, however I have recently discovered that changing the background color using Display.setInitialBackground() with glClear and trying to draw a texture at ...
-2
votes
0answers
21 views

libGDX interface cannot be applied error

I would like to use interfaces in libGDX. I get an error in AndroidLauncher before compile. It says for this line: initialize(new MyGdxGame(actionResolverAndroid), config); .... cannot be ...
0
votes
0answers
282 views

Body gets recreated

In my game you have the Square, which is the player, and the Circle which is the enemy, the player carries a weapon, when shooting the game calculates where to place the bullet in relation to the ...
0
votes
1answer
44 views

Implementing Spine animations in Libgdx

I've been searching a lot for a guide on how to implement 2D animations exported from Spine to Libgdx, but all I could find was outdated tutorials and source codes. I can handle basic Libgdx but Spine ...
2
votes
2answers
97 views

AI for Shogi, dealing with high branching factor due to drop rule [on hold]

I'm writing a Shogi program with a computer player in Java from scratch as my undergradute dissertation project. Due to the drop rule, when the computer player captures a few pieces, the branching ...
0
votes
0answers
31 views

Store a Unity map on server-side

For a 3d Hack'n'Slash game I am currently using Unity as client and Java wit OGserver (Netty with some game-related features) as Server. I am on the map part of the development, actually I just have ...
0
votes
1answer
53 views

OpenGL ES 2.0 2D-Image displaying

I have followed the official OpenGL ES tutorial to create a working OpenGL-environment. I have been able to do anything I wanted to except for displaying 2D-images. To do so I worked through this ...
0
votes
0answers
29 views

In Java swing, while handling a 2D top down game, how should I handle scaling for quality transformations (mainly screen rotation)

For my top down game, I plan to have screen rotation where entities don't rotate, but everything else does. I am using a raster array to store my image so I don't have to render things stacked on each ...
0
votes
1answer
70 views

2D planetary system simulation- how to improve gravity model? How to control simulation speed?

I'm making a simple planetary system simulator. I've run into some problems with physics model and simulation speed and I'd like to learn how to fix them. My main class is Body: public abstract ...
0
votes
1answer
38 views

Libgdx distorted texture size

I'm just starting to learn LibGDX and have been having some troubles getting my world size to match with my texture size and box2d bodies. I have a texture 64x64 that I am trying to display but it ...
0
votes
0answers
27 views

Problem with keyListener

I have written some code that makes a labyrinth,and fills the JPanel with my figures (Wall, Player, Road and Gate). I want to move the player with WASD, so I have written the following code. The frame ...
0
votes
0answers
23 views

JBullet - Two RigidBodies will not collide

I am adding two ships into my collision world. (The green dots are the collision shape (an ObjectArrayList) that I am passing to the ConvexHullShape) However they don't seem to collide. In fact, ...
1
vote
2answers
70 views

OpenGL Vertex Array Object(VAO)

I have drawn a triangle and a square using open gl and everything was fine. I have then tried to draw the same triangle and square, while implementing VAO's and now I only get a white triangle - ...
3
votes
2answers
72 views

Best way to deal with a large variety of items?

I am currently working on my first java game and I am having trouble figuring out how I should implement my classes that will have heavy variety. For example, I am considering having an abstract item ...
0
votes
1answer
48 views

Libgdx - Jumping, What am i doing wrong?

I really can't work out whats wrong with my code. I have an input listener for gestures, when I Swipe the position goes up on the y axis fine but he doesn't come back down, if with Gravity added. I'll ...
2
votes
1answer
38 views

JBullet - How can I make my object float on the water?

I'm trying to use JBullet for a ship PVP game. I've got two ships which are meant to rest on the water. Obviously these ships will be colliding, but the problem I have currently is "water" ...
0
votes
0answers
20 views

Shaperenderer not showing any shapes

I'm trying to use the shape renderer in LibGdx, but I don't see anything. I followed the docs as well, but nothing appears. Is there something wrong with my setup? public class MyGame extends ...
0
votes
2answers
33 views

Ball oblique impact physic in Java?

I know Q3 + Q4 = 90 I searched internet and many physic topics, but not found how to calculate this values in Java? (I found V3 and V4 but not found Q3 and Q4) So how can i calculate V3, V4, ...
0
votes
1answer
73 views

Platformer collision advice

I've been trying to implement collision for a platformer but I can't find a good way to get the collision of certain sides without it get glitchy. So i try to get the collision of the top rectangle ...
-3
votes
1answer
42 views

String of coordinates into an ArrayList? [closed]

I have a String with coordinates which looks like this: (These coordinates are loaded from a text files and tells the position of entities) String coords = "0,0 0,1 5,2 7,4 10,5" My question is, ...
0
votes
1answer
46 views

Pan camera within bounds of large image

I have a camera that I pan around a large image which works fine, however when I reach the end of the image I can keep panning on and on, forver. I have looked everywhere for an answer on how to ...
0
votes
2answers
62 views

GestureDetection Issues - How do I make my Actor jump on Swipe?

I've been trying to solve this for hours now, In theory I totally understand how the GestureDetector works but I'm trying to integrate it with the Libgdx SuperJumper Tutorial (for now). Here: ...
0
votes
3answers
59 views

Why should i set glClearColor and setProjectionMatrix in render method many time in LibGDX?

import com.badlogic.gdx.Game; import com.badlogic.gdx.graphics.OrthographicCamera; import com.badlogic.gdx.graphics.g2d.SpriteBatch; public class MyGame extends Game { public OrthographicCamera ...
0
votes
1answer
35 views

Moving a Polygon based on Camera position [JAVA]

I am in the process of implementing TMX Maps (made in Tiled) for my game. In Tiled, I can create polygons, which leaves a tag, containing the points. Loading in these points to a Polygon ...
0
votes
0answers
43 views

Hard time implementing AABB collision into a platformer

I have AABB collision working fine. The problem is I can't get it to work with a platformer style game. The collision makes the player move a bit static when colliding and the gravity wont work with ...
0
votes
1answer
27 views

Opengl textures change color of everything

Whenever I render textures, all shapes get the color of the texture. I'm not sure why, but I think it's something to do with the way I render textures. Here's what I use to draw textures: public void ...