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
2answers
27 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
13 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
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
15 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
20 views

Game Engine Null Pointer Exception? [on hold]

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
1answer
29 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
3answers
50 views

(LibGdx) Get mouse position in ENTIRE game [on hold]

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?
1
vote
2answers
70 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
46 views

Handle Entities & Collision in large numbers [on hold]

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
78 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 ...
-1
votes
0answers
53 views

A* Search produces infinite loop [on hold]

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
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) { }
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
0answers
16 views

NullPointer calling scrollpane draw from a libgdx application [on hold]

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" ...
-2
votes
0answers
20 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
21 views

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

I need to loop through all the tiles and use my personal collision class. How do I loop through them?
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: ...
1
vote
1answer
31 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 ...
1
vote
1answer
24 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
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
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
0answers
23 views

Display black on loading texture [on hold]

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 ...
0
votes
0answers
13 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 ...
1
vote
2answers
109 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
24 views

rotate to movement direction [duplicate]

If I have a player character that can move 8-directionally, I can set the rotation of the player to face the direction of movement. But if I want to smoothly rotate to a direction, sometimes the ...
-1
votes
0answers
23 views

LibGDX/Java - IllegalArgumentException causes my game to crash whenever my main character touches a Coin [closed]

Trying to figure out why my Android game crashes whenever the player touches an animated coin. I have attached an image of the LogCat and my code is below (NOTE: all game objects in ![Renderer] are in ...
-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 ...
0
votes
0answers
8 views

Java Serialization and references [migrated]

Say I have a serialized class that is used to save the state of my game. This serialized text is stored in a text file. If I restart my computer, reinstall java, etc. If I try to deserialize that ...
1
vote
1answer
89 views

Delta time not accurate enough

In my game i have a delta timer based almost exactly on the page from here http://wiki.lwjgl.org/index.php?title=LWJGL_Basics_4_%28Timing%29 But if the the main loop is fast enough, my delta time ...
0
votes
1answer
124 views

Smooth Npc Movement

I have an Npc in my rpg that moves around based on a Random() variable. My main goal is to have him walk in a random direction a small bit every 2 seconds. I only want him to move about 32 pixels ...
1
vote
0answers
41 views

How to eliminate the outline in libgdx?

I'm recently started working on a game in libgdx, and I've run into the problem that my sprites tend to get a thin, whitish outline around them. This is especially a problem for me since I'm working ...
-2
votes
0answers
55 views

Are modular asset loading systems efficient? [closed]

I want to make my game easily expandable and I was wondering whether making the asset loading system (the system that loads the assets) modular (in modules that are loaded piece by piece rather than ...
0
votes
2answers
91 views

Optimizing Collision Detection in a 2D Game

I am optimizing my "little" Java (LibGDX) shooter game, and perhaps unsurprisingly, collision detection is a "bottleneck"; I've kind of reached my performance goals already, but I want to tweak the ...
1
vote
1answer
70 views

Why would OpenGL ignore GL_DEPTH_TEST setting?

I cannot figure out why some of my objects are being rendered on top of each other. I have Depth testing on. glEnable(GL_DEPTH_TEST); glDepthFunc(GL_LEQUAL); Do I need to draw by order of what is ...
1
vote
0answers
29 views

Lag when drawing single Texture multiple times in libGDX [closed]

I am building a game where you are basically drawing little dots on the screen with the help of the accelerometer. I am using a single instance of an Actor where I store the coordinates that needs to ...
1
vote
2answers
76 views

How to determine this kind of vector?

Take a look at the picture. I've got a camera(brown) and its ray(red). As I know ray has a direction and unlimited length(if you don't set it yourself). But now I need to determine ray's vector ...
0
votes
0answers
28 views

How to draw multiple large background images using libgdx?

I have developed a basic lunar lander-style game using Slick2D and dyn4j and am now redeveloping it using libgx for various reasons. I am having problems drawing the background (i.e. everything, but ...
0
votes
1answer
34 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 ...
1
vote
1answer
83 views

Does compressing data before transfer make a game run faster?

I want to make my game as fast as possible as it is real time and fast paced. I have already decided to encrypt my data here and I was wondering whether compressing it would be faster for the client ...
0
votes
3answers
141 views

Is it worth it to encrypt data?

I am using Java to write a moderately simple video game and I need to transfer some large files (edit: Live game data and possibly assets.) between the client and the server. I need to decide whether ...
1
vote
2answers
44 views

How can I attach a libGDX actor to a box2D body?

I'm creating game like hill climb racing. I created my car with the help of shapes and joints but I don't know how to attach graphics to it. I used actors and sprites before for the sake of learning, ...
0
votes
0answers
39 views

GPU skinning weird issue [duplicate]

I finally got my GPU skinning to work! (Mostly) I'm using MD5 format and this here tutorial However the weird part is that I'm getting EXACTLY the same issue as this unanswered post: here The ...
1
vote
1answer
45 views

How do you save Path2D data?

I am making a java game using path geometry. Is there any way to save the data stored in a Path2D to a file?
0
votes
1answer
41 views

Sprite rotation LibGDX

I'am using the current mouse position to aim the player sprite, but I am not getting the best results. I want my sprite to have the direction pointed wherever my cursor is in the screen. Here's my ...
0
votes
1answer
27 views

Get color array with alpha for an image in java

I can get the pixel array like this: int[] pixels = image.getRGB(0, 0, width, height, null, 0, width); But it ignores the alpha channel, I only get the rgb (I'm reading a PNG image). How can I get ...
0
votes
0answers
25 views

Radial gradient is not transparent at edges

I have a circle drawing algorithm, which is this: public void renderCircle(int xp, int yp, int r, int color) { int[] pixels = surface.getBuffer(); for (int y = -r; y <= r; y++) { ...
0
votes
1answer
65 views

Transparency on pixel level?

I'm using java and I do pixel-by-pixel rendering (a pixel array from an ARGB BufferedImage). So a color is 0xAARRGGBB. Now how can I render a transparent color? I guess that I should manipulate the ...
0
votes
0answers
14 views

Box2DLight position seems to Floor

I am creating a top down game and i'm using raycasted lights from Box2Dlights, My light is all set up and working. its attached to the player's Body, and when the player moves, the sprite I attached ...
0
votes
1answer
65 views

Java 2d Gaming, best practice to update random falling objects

I'm new to game development. I do have basic knowledge in Java and also have moderately good experience in OOP from other languages. I started developing this simple 2D game as my first project. The ...
0
votes
1answer
56 views

Bounding Box not rotating based on draw rotation (Java)

In the process of developing a 2D game and am having some issues with translating coordinates on rotation. The object being rotated is a sword that is attached to the player. The player currently ...