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

NullPointer calling scrollpane draw from a libgdx application

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

A* Search produces infinite loop

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
96 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
17 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
8 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
151 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
29 views

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

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
23 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
16 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
16 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?
1
vote
1answer
19 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
150 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
66 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
38 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
23 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
568 views

Including slick2d or slick-util in maven build?

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
22 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 ...
1
vote
1answer
134 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
665 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
104 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
10 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
242 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 ...
0
votes
1answer
29 views

box2d ChainShape into curved line

i need to draw a curved line , i searched the internet and found nothing , maybe someone with knowlegde on the subject can help me with a link , i used chain shape and did this , and i don't know ...
1
vote
2answers
38 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 ...
-2
votes
0answers
54 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
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
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 ...
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
149 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
154 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
20 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 ...
0
votes
1answer
122 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
1answer
87 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
140 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
36 views

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

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

Unity alternative? [closed]

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
40 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
215 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
133 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
450 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
88 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? [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 ...
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 ...