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

Enum game state, help needed [on hold]

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

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

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
25 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
15 views

Info about java applet (validity and performance) for develop a game [on hold]

I program in C++ and Java, and i know the basic structure on how java applet works (i've made one for educational purpose, only awt btw). As hobby i want to try to develop a game, but i don't know ...
0
votes
0answers
34 views

opengl camera scrolling too fast

Im using the code from this tutorial but in java and lwjgl http://lazyfoo.net/tutorials/OpenGL/04_scrolling_and_the_matrix_stack/index.php . The problem is i want the player to click and drag around ...
0
votes
1answer
32 views

How to implement a GUI in a JPanel

I have a game that I am programming in Java from scratch for fun. And I have run into the problem where I want an Inventory system to pop up when you press the 'I' button or something (i know how to ...
0
votes
0answers
12 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
15 views

render map with objects in slick2d [closed]

I have a problem when rendering a map with a layer of objects in slick2d. I have a map with two layers of patterns that render in slick2D Tiled, but once you add a layer of objects, the map fails to ...
0
votes
0answers
6 views

Eclipse import Gradle project download takes forever [closed]

I tried to generate a project with libGDX and then import it into Eclipse but it takes more than 5 hours on downloading dependencies, however, it works fine from the command line but not Eclipse or ...
0
votes
0answers
29 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
14 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
45 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 ...
2
votes
1answer
38 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 ...
0
votes
1answer
48 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 ...
0
votes
2answers
45 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 ...
1
vote
1answer
55 views

Java - Load new classes from a folder automatically at startup

I want to make my game-coding very flexible; so I wanted to make the game automatically load new Mobs from a folder named "mobs". This must be only at startup; not while it's already running. I just ...
1
vote
0answers
24 views

libGDX: Linking 3D scene from 2D screen

Using libGDX I have created a few 2D screens, such as a splash screen and a main menu, and also created a 3D scene which I want to be able to load when clicking a button on the main menu. I know how ...
0
votes
0answers
15 views

Login handler for server logic in Poker

I am developing the server side of a multiplayers Poker game. My server has zone/room architecture. If users want to enter a zone, they have to submit login information to server. After receiving that ...
1
vote
0answers
11 views

LibGDX and Sound Priorities

According to a post I found, the setPriority of a Sound in LibGDX is not only a hint, but does nothing on desktop, and I can confirm this. I really need priorities for sounds in my desktop game. The ...
0
votes
1answer
35 views

How to read a custom map format [closed]

I am trying to create a custom map format for my own little 2D RPG, so my question is rather how do I manage reading and creating a custom map format properly and flexible. First off, I am writing my ...
-1
votes
1answer
36 views

Java libgdx get clicked square without iter

I would like to detect which square is clicked without iterating over all elements! i don't want to do this anymore for all elements. if( x >= this.getAnchorX()-HalfWidth && x <= ...
1
vote
0answers
45 views

Drawing fonts with LWJGL3 with OpenGL

I'm very sorry if this question has already been answered, but since I've been struggling with this for many days I thought I'd give it a shot here. My goal is to somehow render some text on the ...
0
votes
1answer
40 views

Java 2D Game Hitbox Detection & Rounded Corners

I am working on a simple 2D game with Java, swing and no framework. I have a rectangular player that the user can move around. On the map are few obstacles which the player should not be able to go ...
0
votes
0answers
17 views

JBullet - Object is colliding at the wrong location!

I'm trying to make archers walk on my ship. I create the ship mesh like this: { Model mesh = null; try { mesh = OBJLoader.loadModel(new File("res/ship.obj")); } ...
0
votes
0answers
12 views

How to zoom and scroll in libGdx?

I am trying to both A.) Pinch zoom my game scene and B.) Move (scroll) my game scene but I have not found many examples. I learn more by examples than by reading API documentation (although I am ...
0
votes
1answer
35 views

Libgdx Actor touch undetected

I am looking for detect touch in an actor. The touch in my game is detected in wrong part of the screen. I want to detect touch only on the red circle, here is the code: Static_values public class ...
0
votes
1answer
18 views

How to map texture to shape in Slick 2D

I need to map texture to shape. Texture: This is a example of shapes I need to map texture to: Notice that each piece in mesh has exactly 4 point to map texture. Logic is pretty straight ...
1
vote
1answer
64 views

Rotating a swinging sword in LWJGL gives wierd results

I'm making a 2d top down game in Java using LWJGL(OpenGL, essentially). I recently tried adding a swinging sword mechanism. My coordinate system is set to the bottom left FOR ALL objects. The rotation ...
2
votes
0answers
29 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
1answer
87 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
27 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
1answer
27 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 ...
0
votes
1answer
38 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
75 views

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 ...
1
vote
2answers
64 views

Making an organized rendering class [closed]

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
1answer
57 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 = ...
3
votes
1answer
138 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
38 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
23 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
71 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
40 views

Should I handle mobile collision from the mob or projectile? [duplicate]

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
83 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
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
28 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
19 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
26 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
1answer
82 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
104 views

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

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
33 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 ...