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

1
vote
2answers
30 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, ...
4
votes
5answers
5k views

Why does my rectangle-circle collision handling misbehave in this fashion?

Ok so this is for a small uni project. My lecturer provided me with a framework for a simple brickbreaker game. I am currently trying to overcome to problem of detecting a collision between the two ...
1
vote
1answer
50 views

In JBox2d when dragging a Body, why is the direction is flipped vertically?

Why is it when I drag a JBox2d Body with the mouse, the vertical component is flipped? e.g. If I drag down-right, the Body moves up-right. Is this expected behaviour, a bug in JBox2D, a Mac ...
0
votes
1answer
57 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) ...
-2
votes
0answers
51 views

Are modular asset loading systems efficient? [on hold]

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
1answer
266 views

problem adding bumpmap to textured gluSphere in JOGL

I currently have one texture on a gluSphere that represents the Earth being displayed perfectly, but having trouble figuring out how to implement a bumpmap as well. The bumpmap resides in ...
0
votes
0answers
19 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 ...
0
votes
1answer
224 views

LWJGL: Camera distance from image plane?

Let me paste some code before I ask the question... public static void createWindow(int[] args) { try { Display.setFullscreen(false); DisplayMode d[] = ...
1
vote
1answer
146 views

Design pattern for animation sequence in LibGDX

What design pattern to use for sequence of animation that involve different actor in libGDX. For example I am making a game to choose a wolf from a group of sheeps. The first animation played when the ...
0
votes
1answer
62 views

TileMap not not rendering [on hold]

I have a tile map that I would like to be able to move while playing the game. In the code you will see the posX and posY variables. I used these variables so that when I complete this, I can have the ...
0
votes
0answers
153 views

Playing repeated sound in Java

I'm trying to play sounds in a Java game with the following code: AudioStream audioStream = new AudioStream(stream); AudioPlayer.player.start(audioStream); The stream variable is just an ...
-1
votes
0answers
16 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 ...
0
votes
1answer
117 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
votes
0answers
7 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
80 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
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 ...
0
votes
3answers
136 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
votes
0answers
32 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
64 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 ...
1
vote
0answers
35 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
1answer
6k views

How can I make a sprite-sheet-based animation system? [closed]

I want to make animations based on a sprite sheet, but I'm stuck implementing it. The key things I need my code to do are: Play through a set of images once (e.g. a jump animation) Loop through a ...
1
vote
2answers
207 views

How do I ensure my skybox is always in the background, with OpenGL?

I created a skybox in OpenGL (through LWJGL), but the only way I found to render it behind all objects was to make it very big. This leads to ugly edges between the 6 skybox planes. Optimally, I ...
2
votes
1answer
131 views

Does Libgdx being “for Desktop” mean dependency-free native executables?

I want to clarify whether the Java Framework "LibGDX" can be used to compile games to native executables. The description/tagline says "Desktop/Android/HTML5/iOS Java game development framework". I ...
-1
votes
3answers
449 views

adventure game architecture

I would like to make an adventure type game functioning similarly to machinarium or broken sword. The only way I can think of doing this is to draw an image as a background on a canvas and use some ...
0
votes
2answers
80 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
22 views

Visual effects in Java? [on hold]

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 ...
1
vote
1answer
67 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
21 views

Determine character movement from a top down perspective [on hold]

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 ...
0
votes
0answers
18 views

Using a player class to hold data [on hold]

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 ...
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 ...
1
vote
0answers
25 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
75 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 ...
1
vote
1answer
133 views

Get the game state using Multithreading in Java Monkey Engine 3

I’ve been trying out Java Monkey’s multi threading recently via the wiki’s tutorial. Since I just wanted to test a prototype clinet, I made a program which creates some cubes using the ‘Cubes’ library ...
0
votes
1answer
147 views

GPL Game Engine - What needs to be released under GPL?

I'm hoping I can clarify this issue. Note, a similar question has been asked here, but it doesn't really give a specific enough answer that I can comprehend at this point! :- How does one escape the ...
0
votes
0answers
21 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
2answers
186 views

Recommended approach for event system in Java

What are the recommended approaches for an event system of a turn-based RPG's battle engine? The system I'm currently working on has a runEvent method that sorts the actions queue based on their ...
0
votes
1answer
72 views

Mouse coordinate conversion Libgdx

I have a camera: //Map is a my object that wrapper of TiledMap class In the create method: this.renderer=new OrthogonalTiledMapRenderer(this.map.getMap(); this.camera=new OrthographicCamera(); ...
0
votes
1answer
70 views

LibGDX - Accelerometer Problems

I got some issues. I'm using LibGDX. When I hit an object, my Fighter is supposed to fall to the Ground. BUT, because of the Accelerometer, i can still move it up and down eventhough it died. The ...
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 ...
0
votes
0answers
27 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
1answer
96 views

Moving a tiled map in a jframe

I rendered a tiled map, with the help of slick2d, in my JFrame in Java. I can move my main character, but it is just that the character itself moves. I would like to do it that, if the player moves, ...
2
votes
1answer
81 views

Edit spawn location according to vector direction

I'm trying to make a turret in Bukkit (Java). This will shoot an arrow to the players that are in the shooting radius. But now I've a little problem, the arrow gets stuck inside the block where its ...
0
votes
1answer
88 views

Slick2D: Animation not being parsed from spritesheet correctly

I have a 960x960 spritesheet with each tile being 192x192. I initialized my spritesheet and animation like so: spritesheet = new SpriteSheet("resources/spritesheets/player.png", 192, 192); ...
-1
votes
0answers
29 views

Draggable tiled map with locations to klick on (libgdx) [closed]

I'm currently working on a tiled map with tiled. So I want to make it draggable and set positions where the player can click on. Then an event should be triggered. I need some instructions how to do ...
0
votes
1answer
79 views

Ram usage , libGDX game development

I am developing android game using LibGDX . The game data (images , sounds etc.) are maximum 25mb . But when the game is running on Android device it places 110mb there (look at the image) 110mb is ...
1
vote
1answer
127 views

convert image to spritesheet of tiles for isometric map?

is there a way to convert an isometric image (like the first image) to a spritesheet (like the second image), in order to place each image on the isometric map with the code? The map looks like the ...
1
vote
1answer
78 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
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 ...