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
3 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
4 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
18 views

Broken World Generation [on hold]

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
45 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
21 views

Display black on loading texture

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
9 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
103 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
18 views

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

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
8 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
86 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 ...
-1
votes
0answers
34 views

LibGDX - Is it worth making a World class for my game? [on hold]

Right now I pretty much have a World class across 3 classes (Player, Game, Renderer) if that makes sense? Game is where game objects are initialised, and Renderer just draws the objects onto the ...
-1
votes
0answers
71 views

Unity alternative? [on hold]

I have been trying Unity for the last few weeks, but I don't really like it. It is way to much constructing instead of coding yourself, and I think the coding is the best part. Do you have any ...
0
votes
1answer
121 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
37 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
52 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
0answers
22 views

Visual effects in Java? [closed]

I'm about to work on mini game right now. I use eclipse and was wondering if there's any library thet would let me achieve visual effects like fade in, for example when clicking something in a game ...
0
votes
2answers
87 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 ...
0
votes
0answers
21 views

Determine character movement from a top down perspective [closed]

I'm working on a survival open world game. I've been experimenting with different types of views and control schemes. It's a top down game like the first two Grand Theft Auto games. Type A Player ...
1
vote
1answer
68 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 ...
0
votes
0answers
19 views

Using a player class to hold data [closed]

A year and a half of game development and I haven't made a player class since I first started. What would be a good way of going about this. Right now I just save player data onto a file and convert ...
1
vote
0answers
28 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 ...
0
votes
0answers
22 views

How to rotate a sprite from sprite sheet (sequence of rotating frames) using keyboard in Java [closed]

I am making a game for my HW project. Right now, my tank can move forward(right arrow), backward (left arrow) and fire when moving left or right. I currently have a Tank class which receives the ...
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
26 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
0answers
30 views

How to create Game levels in LIBGDX android game [closed]

Can anybody Guide me. I need to Create Game levels in LIBGDX android game that I have created using kilobolt zombie bird tutorial that is here ...
0
votes
0answers
24 views

How do i view minecraft forge commands in eclipse and how can I “learn the syntax” of making a mod? [closed]

I started learning Java a while ago and I have a decent understanding of the language (Im about half way through Herbert Scheildns Java a begginers guide book) I really wanted to code a minecraft mod ...
0
votes
2answers
20 views

libgdx spect ratio not working on android

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
139 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
35 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
38 views

GPU skinning weird issue

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
38 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
64 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
12 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
64 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
54 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 ...
0
votes
0answers
13 views

Unity StartApp Ad Sdk dims the screen down when showed

I'm making an android game Which Never Sleeps and it don't. But When Using Startapp ad sdk It seems that it pauses the game and the mobile sleeps when the ad is shown. As if the sdk handles it from ...
0
votes
2answers
46 views

How to prevent constant movement

So I have this code for moving a pointer up and down in a menu. The only problem is it moves way too fast to even stop on any of the selections. It does go to each one, but even just a quick tap of ...
0
votes
2answers
64 views

Placeing stones/tiles on a board game

I am a beginner at libGdx. I am building a board game (the Fanorama game). I would like to use a pic as the board and place the pieces on the board on top of the board sprite. Is there a nice way to ...
0
votes
0answers
19 views

I just can't get glg2D to work, what is wrong?

I would like to use the glg2d library for my project (I'm using eclipse) but I always get an error. First I included jogl and gluegen, and gave it the native folder, and it seemed fine, no errors. I ...
0
votes
1answer
60 views

Reconstruct shader vertices in OpenGL

I'm not sure if 'reconstruct' is the correct term for this but essentially what I am trying to do is calculate vertex positions (that are already calculated via shader) on the CPU for the purpose of ...
0
votes
0answers
19 views

LWJGL 3 crashing on nglDrawArrays

I have 2 classes I'm trying to use to render a triangle, and it's crashing on nglDrawArrays, the error is in the native code, and the only information I'm getting from the JVM is a native error ...
3
votes
2answers
90 views

How can I support remappable controls?

I am trying to allow players of my game to remap the controls (eventually from the menu). Currently, some of the buttons have been defined, but they can't be changed. They are hard-coded. For example, ...
0
votes
0answers
48 views

Java Graphics performance issue when drawing transparent shapes

I've started working on a game engine for fun with no external libraries. I've started creating a simple particle system and I've come to some huge performance issues. I have the following frawing ...
0
votes
0answers
111 views

Slick2D shader crashes, but only after a while

I'm using Slick2D's ShaderProgram for shader-based drawing in my game. Some players report that after 3-10 minutes, the game inevitably crashes hard during what appears to be a setUniform4f operation ...