Java is both a popular object-oriented 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
1answer
41 views

Libgdx crash on dispose()?

Whenever I try to manually call the dispose method in one of my screen my game just crashes. My dispose looks something like this @Override public void dispose() { battletheme.dispose(); ...
2
votes
1answer
957 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 ...
2
votes
1answer
38 views

LibGDX: Do I have to dispose a texture if I load it from AssetManager?

AssetManager manager = new AssetManager(); manager.load("texture1", Texture.class); manager.load("texture2", Texture.class); manager.load("texture3", Texture.class); //And so on... And then I load ...
0
votes
1answer
59 views

libgdx FollowPath proper usage

I'm developing top-down rpg game and got some problems using https://libgdx.badlogicgames.com/gdx-ai/docs/com/badlogic/gdx/ai/steer/behaviors/FollowPath.html I have a path (picture 1), in this case 2 ...
0
votes
2answers
49 views

Java map generation

What is better way of setting up a map for a java 2D topdown game? Would it be having an ArrayList of tiles, a simple 2D array, a HashMap? (Note: the tiles/blocks or whatever are squared)
1
vote
3answers
110 views

Most optimal way to load 2D world

I am creating a 2D car racing game. (Yes, a Hill Climb Racing clone) What I am doing right now is load 10% of the map every time the user gets to 7%. For example: Imagine the map has 10km. (10000m) ...
0
votes
0answers
17 views

Surface View show black screen

i need necessary help! please anyone?! My GamePanel's Surface View show black screen (or don't show at all) on testing even though in the code every-thing looks fine!! Am i missing something?! Note: ...
1
vote
1answer
30 views

find Vector2 libgdx

I need to get coorinates of red point. Coordinates are just for example, it would be better to see the common formula. Found code like this, but it gains wrong result.() Vector2 o = new ...
0
votes
0answers
15 views

LibGDX BoundingBox + pickRay issue

I've been following this tutorial for trying to be able to detect if I have clicked on a 3D model, but am running into some issues. Here's what I have — public GameObject getObject (int screenX, int ...
-1
votes
3answers
449 views

Tile Based Collision Checking In Java?

I have my map stored in 2 arrays: Tiles : Tile names TileTypes : SOLID or BASIC I want to be able to walk through BASIC Tiles (Like ground tiles). But not the SOLID Tiles (Like wall tiles). I ...
1
vote
1answer
47 views

How can I fade in 3D foliage smoothly?

Take a look at this picture: This is a picture of me diving down from a high height. As you can see, the world is a simple world with grass, snow, trees, etc. The problem here is the 3D foliage. If ...
1
vote
2answers
52 views

what is the best way to make a bunch of platforms appear randomly on a JFrame but close enough the player can reach them? [duplicate]

Hi I'm trying to make a screen that will have a bunch of platforms that will place themselves randomly around a JFrame. I know how to do the stuff to make the character jump and to deal with the ...
1
vote
0answers
30 views

Extrapolation - synchronize destination point on a second device while moving

First of all, I read all of the Valve and Gaffer articles but I still have no clue, how to achieve my goal. I am creating a UDP multiplayer game with a lot of physics (knockbacks, attacks). Packets ...
1
vote
2answers
295 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 ...
0
votes
1answer
331 views

Why is my screen black?

I'm developing an android game, and my screen is not displaying what I want it to. I've read various tutorials but they are either outdated or hard to follow. I have followed this tutorial and most of ...
2
votes
1answer
201 views

How to draw a polygon with picture in libgdx?

I'm working around a simple rectangle game, It just split the rectangle in to a lot of polygon debris. I use Pixmap and Texture to draw the edges of each polygon. ... for (GraphEdge e: _edges) { ...
2
votes
1answer
83 views

Slick2d fullscreen with black bars

NOTE: I am moving this question here from Stack Overflow because I feel it belongs better on this forum. I am deleting the original question from Stack Overflow. I'm working on a game in Slick2D and ...
1
vote
1answer
92 views

LibGDX - Level management on a level-based game

I'm new to LibGDX and android development in general and am trying to do a puzzle game. Being a level-based game, i'm trying to make it so in every level a certain number of blocks (just rectangular ...
1
vote
1answer
292 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 ...
0
votes
1answer
102 views

Detecting collision with walls (is this a good solution?)

I'm trying to make the collision smooth (it must open the animation, but not move the character). I've implemented 'fake positions': int step = 20; fake_left_x = x-step; fake_right_x = x+step; ...
0
votes
1answer
20 views

OpenGL color overlay

I want to create a pause menu where everything in the background gets darker. I've looked up a bunch of possible solutions (even the second page on google) but it doesn't seem to work. I do already ...
0
votes
2answers
42 views

How to convert velocity (Vector) to m/s (Scalar)

I have a variable called velocity which I get from a dynamic body in Box2D. It is the velocity of a pirate ship and when I add torque to the ship I want that to be proportional to the speed (m/s - ...
1
vote
2answers
26 views

Libgdx rendering problems

Have problems with rendering moving character using ShapeRenderer, it twitches while moving, and I don't understand where from comes the problem - bad game structure (do I need to override draw method ...
4
votes
1answer
74 views

Finding it difficult getting to grips with LibGDX [closed]

So I have spent about a week now learning libGDX and have made very little progress. I started small and wanted to make a strategy game where there is a tiled map of squares and you control a ship, ...
3
votes
1answer
39 views

Static body bridging two other static bodies

I have two box2d bodies like below, What I need is to create another body that kind of bridges this two bodies. I am not looking for a box2d joint, but a body that will be like a bridge touching the ...
3
votes
1answer
55 views

Frustum Culling: How to calculate if an angle is between another two angles

I am trying to implement frustum culling but got stuck on how to determine if the angle that the object is from the player is in the FOV of the player. So basically I have the following information: ...
-3
votes
1answer
30 views

Manager classes benefits [closed]

I am wondering if there are any other advantages to using new classes for managers, eg game state managers, other than readability/organization.
3
votes
2answers
81 views

What should be the code design for interactions management in a game with lots of object?

I'm writing a 2d game for Android in Java using LibGDX. The game consists many interactions between different types of objects. Most of them happen between enemies and bullets. At the beginning, I ...
0
votes
2answers
130 views

2D TileMap smooth lighting

I want to implement (a smooth) lighting into my 2D Maps. I want to have the basic idea. What I thought of is 2 components. The Scene's Ambient light: The Tiles and Sprites are tinted into this colour ...
1
vote
1answer
45 views

3D mesh culling issue, further faces showing through closer faces

I'm trying to render a generated mesh using libGDX which acts as a java wrapper for openGL. The issue i'm having can be seen in the screenshot below. The faces of the mesh that should be hidden by ...
1
vote
0answers
57 views

why doesn't work this example [closed]

I am new to game development. I was trying to use this http://blog.gemserk.com/2012/07/03/drawing-a-projectile-trajectory-like-angry-birds-using-libgdx/ projectile example in eclipse android using ...
4
votes
2answers
55 views

Does scene2d(libGDX) know when an image is drawn out of the screen?

I mean, I want to make a tiled map using scene2d, so in the render method of my game... @Override public void render(float delta) { Gdx.gl.glClearColor(0.5f, 0.5f, 0.5f, 1f); ...
2
votes
2answers
83 views

Android libGDX FreeTypeFontGenerator exception

I am working on a libGDX project for Android. Since I added the following code, running the game on my Android phone produces an exception: final FreeTypeFontGenerator generator = new ...
0
votes
0answers
17 views

Rotate object from an origin using a transformation matrix

I'm making a project in lib GDX and I want to rotate an object by changing the transform matrix of the sprite batch to one that rotates an object rendered on screen a given number of degrees from a ...
0
votes
0answers
34 views

multiplayer/network security and guidelines

I am about to start programming a multiplayer game that uses TCP to transmit data. Just sending data, prozessing data on the server and displaying results on the client isnt that complicated i guess. ...
1
vote
1answer
148 views

How can I make an soundsystem with Slick?

My question would be, how can I develop an easy-to-use sound system under slick-util? Under the function a.playAsSoundEffect(1, 1, true, x, y, z); it already works to create a static position for ...
0
votes
1answer
85 views

Rotate heading relative to agent's local space

I'm having a little trouble translating a point in my game's world space to an object's local space. I have a cannon in my game with a normalized heading vector that's always supposed to point in the ...
4
votes
1answer
2k 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 ...
1
vote
1answer
37 views

When handling key input, I'm getting a negative timeout value in my thread. What's going on?

So I'm programming a game using Swing and AWT and I'm getting a weird error. As I check for input in my MenuState, which is just my Menu screen, it is telling me that the timeout value in my game ...
2
votes
1answer
76 views

Minecraft modding: onLanded and item type/positioning?

My question is about programming Minecraft mods. So i added a block to my Mod. Now I want, that when you drop a sugar on it, that it waits some time and then, if the sugar is still there, it will ...
0
votes
1answer
19 views

Slick & LWJGL Flickering Problem

I have an flickering problem with rendering tiles. Rendering Method. int tileSize = TileManager.tileSize; for(int y = 0 ; y < mapHeight ; y++){ for(int x = 0 ; x < mapWidth ; ...
0
votes
0answers
16 views

Bukkit - Loading chunks in a new world

I'm looking to make a large-scale PVP plugin. On a server network (MCBrawl), there is a game mode that spawns players in a world that I assume is randomly generated every time. I want to make ...
3
votes
3answers
170 views

Procedural Dungeon Generation Connect Rooms With Passageways

I've been working on a simple procedural generation class which currently places rooms on a x, y grid and selects a starting room. Each room needs to be connected with passageways so the player will ...
6
votes
1answer
116 views

Minimum number of moves algorithm in Java

I'm looking to implement the minimum number of moves algorithm for the java game I'm developing but I can't quite figure it out. Here's an example picture: There are also some specifications ...
0
votes
1answer
234 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 ...
0
votes
0answers
27 views

Packaging JARs for Linux

I realise that this question exists but the answer doesn't explain how to create DEB packages and whether they're suitable. I'd like to package my Java 8 game for Linux. Most people don't have Java 8 ...
1
vote
1answer
80 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
0answers
8 views

3D boolean operations in java [migrated]

I am looking for libraries that provide 3D boolean operations in java, to use in a game. If possible, they should have performance and provide textures support at the dynamically generated meshes. ...
0
votes
1answer
54 views

Annoying snag when moving with dx and dy JAVA

I am currently using a keyAdapter with detectors and when I move I change the value of dx and dy respectively. However if I move left then right or up then down quickly, the sprite won't move in the ...
0
votes
2answers
59 views

Interpolation over a network - receiving and drawing an opponent in 1v1 game

I'm a newbie Java coder and I'm creating a 1v1 game with an authoritative server and two clients. My whole network is based on UDP packets: sending positions from clients sending confirmations ...