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

0
votes
0answers
17 views

Intermediate AI for Java games [duplicate]

I want to know how to create good AI for a Java game, I'm still learning the language and I'm not an expert. I can do static AI but wanna know about writing an AI that follows the player and ...
0
votes
0answers
37 views

LibGDX ShapeRenderer graphical glitches

So drawing something static on the screen with the ShapeRenderer is fine but whenever I try to move something it starts glitching out. Here's a vine to show what I mean: https://vine.co/v/OBxFi1P2IO9 ...
0
votes
0answers
13 views

How to compile the MCP to a .jar file? [on hold]

I am making a Minecraft client in Eclipse, and I can run it in Eclipse fine- however I want to allow people to put it into their versions folder and use it out of Eclipse. I also understand that you ...
0
votes
1answer
51 views

2D Tile Movement in Java

I have this tilemap and a player in my game, and I got the player to move by adding the velocity to the position. However, it is very hard to control the player exact this way of the tilemap. So, I ...
0
votes
0answers
28 views

Slick2d - Why is my init() method running twice?

In the init() method, I have called the method loadMap() from the "world" object. But it seems to be called twice. I do not want loadMap() to be called twice. I have no idea why is this happening. ...
0
votes
1answer
95 views

Client side latency when using prediction

I've implemented Client-Side prediction into my game, where when input is received by the client, it first sends it to the server and then acts upon it just as the server will, to reduce the ...
0
votes
0answers
20 views

How can I stop getting errors about my font not being loaded in Java? [on hold]

I have a little problem with my game made in entire Java, using no external libraries, except twitter4j. I have a custom font that I have put into the game, and will be using for the game graphics, ...
0
votes
1answer
2k views

Android Bitmap: Collision Detecting

I am writing an Android game right now and I would need some help in the collision of the Pawns on screen. I figured I could run a for loop on the Player class with all Pawn objects on the screen ...
1
vote
2answers
157 views

Entity Component System: Store pointer in Component to Entity

I was wondering if it is a bad idea to store a pointer in every Component to the Entity which owns the Component. E.g. I have a Component "NPC". Each entity which owns this Component also must have ...
0
votes
2answers
38 views

Mysql database reading and writing [on hold]

In my Libgdx application I would like to be able to connect to a mysql server securely and read and write data from it without other users injecting, or changing information. I've found this: ...
0
votes
0answers
22 views

Drawing particle groups in box2d (java)

Does anyone have any sample Java code for drawing ParticleGroups using JBox2d? I've managed to define a particle group area, but I'm unsure how to draw the individual particles using OpenGL .. ...
0
votes
2answers
129 views

LibGDX how to change animations

I have a Player Class and i have 3 different Animations for it. I can render them perfectly but i don't know how to change from one animation to another. For exmaple i have 3 animations, one for ...
1
vote
1answer
35 views

LibGDX Touch Delay

So I'm trying to make a game in which you have to tap things fast, but the thing is - after you touch something (the area I chose), it takes like 2 more seconds to register another touch. Now, I think ...
0
votes
0answers
8 views

LibGdx - Rotate sprite with mouse

I'm trying to rotate the sprite with the mouse but nothing will happen. void mouseMove() { float angle = (float) Math.atan2(562 - Gdx.input.getY() - player.getY(), Gdx.input.getX() - ...
0
votes
1answer
18 views

Typing text animation (dialogue) libGDX or in general

Can anyone think of an efficient way to animate the typing dialogue text as found in pokemon? I have a vague idea of using string.length, and having a new letter drawn every .2 seconds or so, but ...
0
votes
0answers
21 views

Game Engine Null Pointer Exception? [closed]

I am currently developing a 2D game engine in java just to play around with, but for some reason out of the blue, it started to crash with a null pointer exception telling me something from my player ...
1
vote
3answers
139 views

Making sprite rotate smoothly

I have a sprite that I want to rotate smoothly and face the opposite direction: This is my render function: public void render() { // Game Loop Gdx.gl.glClearColor(0.7f, 0.7f, 0.2f, 1); ...
0
votes
1answer
58 views

Box2D pixel to meter conversion

I have a game that was written in pixels and now I want to change it to meters like(box2D do). How I need to do that. I have wached a lot of tutorials and all they have some SCALING FACTOR but when I ...
0
votes
3answers
51 views

(LibGdx) Get mouse position in ENTIRE game [closed]

I'm trying to get the mouse position IN GAME. By that I mean not the position on the screen, but inside the window. I've been using Gdx.input.getX(), but that's not INGAME. How do I do this?
0
votes
2answers
489 views

Java collision detection and player movement: tips

I have read a short guide for game develompent (java, without external libraries). I'm facing with collision detection and player (and bullets) movements. Now i put the code. Most of it is taken ...
2
votes
1answer
635 views

libGDX using Stage and Actor produces different camera angles on desktop and Android Phone

libGDX using Stage and Actor produces different camera angles on desktop and Android Phone. Here are pictures demonstrating the problem: http://brandonyuh.minus.com/mFpdTSgN17VUq On the desktop ...
0
votes
1answer
36 views

Why isn't my aspect ratio calculation working on Android platforms?

I have this method: public final float aspectRatioHeight(float originalW, float originalH) { float newHeight = (originalH / originalW) * (Gdx.graphics.getWidth()-20); return newHeight; } To ...
2
votes
1answer
311 views

How do I make my camera follow a Box2D object?

I'm implementing a camera in my game. It worked for regular objects, but I began using Box2D and obviously things changed a bit. I have a Body object that I want to draw at the center of the screen. ...
1
vote
2answers
73 views

Memory strategy for multilayer, tilebased maps

I am currently developing a 2d mmorpg and am having some memory issues with regards to my tile based map. The client takes a little while to load and then sits around 1GB ram, because I am loading ...
0
votes
1answer
48 views

Handle Entities & Collision in large numbers [closed]

I am creating a simple 2D maze game and I am a little confused about entities & collision detection. At the moment, my entity class is an abstract class containing position, velocity, sprite and ...
0
votes
1answer
82 views

How can I smoothly move from tile to tile?

I've looked at other games with tile based movement. I am aiming to create a game like pokemon, where the player moves smoothly to the next tile. I am using KeyAdapter, in my KeyInput class. This ...
0
votes
0answers
16 views

NullPointer calling scrollpane draw from a libgdx application [closed]

Solved: Using Stage to display rather than calling the ScrollPane draw method. I get this error when opening the GameScreen and calling the render method. Exception in thread "LWJGL Application" ...
-1
votes
0answers
54 views

A* Search produces infinite loop [closed]

I am having some problems with my A* Search Algorithm. I am new to pathfinding so if I'm doing something really weird please notify me :) Here is the piece of code supposed to generate the path: ...
0
votes
2answers
100 views

get View from LibGDX for Android

I am making a LibGDX app, and I need to get the view to put to an Android app. Here is the code to get the view: package jangkoo.game.shadowfiend.android; import ...
1
vote
1answer
35 views

how to remove game objects after on overlap in LIBGDX game

I have gold stars in my game that give score to game hero if the hero overlap with the star. What I want is to remove star once it overlap with hero object. I give score by checking overlap with this ...
0
votes
0answers
12 views

How to loop through tiles in libGDX [duplicate]

I just need a for loop to show me all of the tiles in a tiled map. for(Tiles t: thetilemap) { }
-1
votes
0answers
14 views

Help Develop 3D Camera “LookAt” Method In JavaFX8 [duplicate]

[I know this question was supposedly answered, when asked by Grady 8 months ago (3D Camera Rotation), but I was unable to follow the solution, and I cannot get hold of Grady, so I am re-asking it with ...
1
vote
1answer
153 views

Why does my depth test fail on Nvidia cards?

I sent a test version of my in-development game to some friends, and they found out that the Depth Test in OpenGL does not work on Nvidia cards. I'm using LWJGL. I use my own matrices and send them ...
0
votes
0answers
48 views

Is there such thing as a design pattern for game character attributes? [duplicate]

I'm toying with the idea of a character based game. The characters, robots, monsters, heroes (and weapons I suppose) will all have various attributes as per a D&D game for example. They player ...
0
votes
1answer
29 views

Rotating and scaling textures built up of pixel arrays in java?

I'm making my first real game, in Java, and I'm currently working on the base system, for rendering images (sprites) and I wonder how I can rotate sprites. My sprite class looks like this: ...
-2
votes
0answers
21 views

Minecraft custom mob: animations

I am quite new to modding and, for that matter, programming in general. I have recently started to mod using Minecraft Forge. I have created a dinosaur-like mob (With which I went kind of overboard ...
0
votes
0answers
22 views

How to loop through all of the tiles in LibGDX [closed]

I need to loop through all the tiles and use my personal collision class. How do I loop through them?
1
vote
1answer
27 views

Drawing shapes and images in libgdx dialog

I am currently working on a dialog window for my android game using libgdx. This dialog window contains a collection of labels and buttons, but should also contain an image. The image represents the ...
1
vote
1answer
151 views

Structure gameobjects and call events

I'm working on a 2D tile based game in which the player interacts with other game objects (chests, AI, Doors, Houses etc...). The entire map will be stored in a file which I can read. When loading the ...
1
vote
2answers
69 views

Make square walk by rotating around corners

I in the very beginning of making a small game, and I'm having some problems getting the basic movement of my character. My character is a square that can be moved by rotating around a corner. The ...
0
votes
1answer
46 views

LibGDX Bounding Rectangles

I'm creating some rectangles surrounding my sprites for my player and bullet class to detect collisions with the overlaps method in Intersector class of LibGDX. I have a question: When I instantiate ...
1
vote
0answers
25 views

Broken World Generation [closed]

I am learning to write java/mod Minecraft. The mod I am working on is just a "Can I do it?" Kind of thing and I have no intention to distribute it. The problem I ran into is when I try to generate a ...
1
vote
1answer
576 views

Including slick2d or slick-util in maven build? [closed]

I'm converting a project to lwjgl and trying to use slick-util as well. There's no slick-util maven repo anywhere (nor slick2d itself anymore). I've included local dependancies before using ...
0
votes
0answers
23 views

Display black on loading texture [closed]

While developing a game with LWJGL I hit a sudden stop with the following issue: Anytime I load a texture using Slick Util, the display stays black until i restart the application. Even when i load ...
1
vote
1answer
135 views

How could I implement 3D player collision with rotation in LWJGL?

I have a problem with my current collision implementation. Currently for player collision, I just use an AABB where I check if another AABB is in the way of the player, as shown in this code. (The ...
3
votes
1answer
700 views

Libgdx - IsometricTiledMapRenderer and light shading

I am wondering if there is any way to simulate light shading in Libgdx using an IsometricTiledMapRenderer. Here is my code to draw an isometric map, it's able to be moved around with the mouse and ...
0
votes
1answer
76 views

How can I make an soundsystem with slick?

My Question would be , how can I develop an easy-to-use Soundsystem under slick-util? Under the function a.playAsSoundEffect(1, 1, true, x, y, z); it allready works to create a static ...
1
vote
2answers
112 views

Boost per-pixel rendering

I'm writing my own renderer in pure java without any external libraries. I'm using per-pixel rendering. I'm rendering an image with this method: public void renderImage(int x, int y, RawImage image) ...
0
votes
0answers
19 views

Slick2D ComponentListener added to MouseOverArea not responding to right mouse clicks

I am developing a UI using Slick2D and experimenting with MouseOverArea. I have noticed that if I add a ComponentListener to my Button (which extends MouseOverArea) it only responds to left-clicks on ...
3
votes
1answer
251 views

Dynamic object creation with HashMap

I want to use a HashMap to dynamically create objects based on the key. I have a Random Map Generator that stores the maps in 3D Arrays of Type Integer[][][]. Upon creation of the actual map I ...