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

1
vote
2answers
299 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
338 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
215 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
97 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
21 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
44 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
28 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
58 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.
4
votes
2answers
88 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
136 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
46 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
57 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); ...
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
149 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
86 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 ...
0
votes
0answers
17 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
177 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
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
35 views

Background with small, randomly moved elements in LibGDX

I'm looking to implement a 'dynamic' background (meaning, with objects moving randomly) in my libgdx game, something similar to what you can see in this video (from the Google Play game 'Finger ...
1
vote
1answer
24 views

Libgdx + Ashley moving one texture causes everything to jump

My problem is that as i am moving my player entity all my entities shift position by the reverse total of my player entities movement vector, However the only system to move things is my ...
1
vote
0answers
24 views

Two devices calling the same servlet, one receives the intended response, the other receives null, but call is definetly made with valid parameters

I'm developing a multiplayer card game (this context only involves 2 players). One player invites other players. Once the game initiator sends all the invites, he goes to a "WaitingRoom" activity, ...
1
vote
2answers
106 views

Random white lines appearing while translating rendering slick 2d images

Hmm I'm getting this weird problem that i think may be a bug with slick but when ever i translate an image in slick 2d for some reason a weird white line appears on the left side of every image like ...
0
votes
1answer
13 views

Method keyTyped in ClickListener is not working

When im click my SelectBox and press some key, nothing happens. sbNationality.addListener(new ClickListener() { @Override public boolean keyTyped(InputEvent event, char character) { ...
0
votes
0answers
18 views

collision detection with rotating Sprite

Im using Libgdx. I have a space ship sprite rotating around the earth trying to avoid incoming asteroids. The ship is being rotated by setting it's origin in the earths center. How do i detect ...
0
votes
0answers
16 views

Adding a score element to your android game

I said I'd show the following 3 classes so that you know exactly what I'm doing. The three class I posted are used in a game I'm working on and they are concerned with the login and register part of ...
0
votes
0answers
18 views

How to hook up mouse listener in Slick2D

I'm trying to code a "Button"-class in java using the Slick2D-GameEngine. Does anyone who is familiar with this engine know where and how exactly to hook up this class to the GameContainer's ...
0
votes
0answers
30 views

OpenGL program not rendering

I tried to create a program that would display a square, but then it didn't. Display.java import org.lwjgl.glfw.GLFWErrorCallback; import org.lwjgl.opengl.GL; import org.lwjgl.system.MemoryUtil; ...
1
vote
1answer
199 views

How Can I Find a Shape on 2D Array?

For the code in my test project, I want to find 2D[,] array shape on the char[][] list. I created an actual map with 'char[][]' array. So, how can I find a tileChar's shape on the worldChar array? ...
0
votes
1answer
434 views

How to make a bar showing the “percentage” of a maximum

so Im making a game and I need a 'bar' to show how much time has passed in ms (dont worry about the time 'mechanics' I only work with the correct numbers). So lets say that the bar is 128px wide and ...
2
votes
1answer
224 views

How do I reverse “Cartesian->Isometric” function?

I'm working on an isometric tile rendering engine and I need to reverse a function I used to translate the Cartesian coordinates into isometric coordinates. I've already written a function for this, ...
1
vote
1answer
38 views

Minecraft Forge 1.8 referencing mod problem

I'm trying to make a Minecraft Forge mod. I've done this before, but I've never worked with entities. So I was trying to add an entity to the EntityRegistry, but I can't seem to reference the mod file ...
4
votes
1answer
72 views

How to spawn Chunks in Libgdx?

I'm currently working on a 2D platforming game with an infinite map. I did my research and I discovered that I can use chunks. Based on my understanding chunks is about spawning terrain at the right ...
5
votes
2answers
142 views

RPG Factions - Friendly/Hostile check

I'm having some trouble checking if one faction is hostile to another faction in my RPG. I'm using enums for my factions and relations but I feel like there's a better way to approach this. Currently ...
1
vote
2answers
203 views

Rotating a swinging sword in LWJGL gives wierd results

I'm making a 2d top down game in Java using LWJGL(OpenGL, essentially). I recently tried adding a swinging sword mechanism. My coordinate system is set to the bottom left FOR ALL objects. The rotation ...
0
votes
0answers
45 views

How to render Fonts with correct size?

I'm making a game using libgdx and box2d so my Orthographic Camera Viewport is only 20x12 pixels/meters, when I try to render the a font on screen it becomes really big and pixelated, I also tried to ...
0
votes
0answers
21 views

Different layouts?

I have had trouble in the past with optimizing my game for different layouts, so that the players don't see the game in different ways on different screens. Someone told me that the normal directory ...
0
votes
0answers
34 views

LWJGL Using wrong openGL version

I am trying to make a game in java using the LibGDX library witch is an extension of LWJGL. LWJGL is claiming that I need at least OpenGL 2.0 with the FBO extension but I only have version 1.1.0. So I ...
1
vote
2answers
148 views

Stop rendering hidden objects libgdx

I currently am hiding objects that are not in the frustums view. However, some objects are still being rendered that are in the frustums view, but are hidden. My goal is to not render objects that ...
4
votes
1answer
85 views

Why Canvas is used more than JPanel for making games in Java?

I saw many ludum dare games, which are written in Java ( using it's standart library ), I checked the code of one or two of them and the thing that I saw is in their Game class, they extends Canvas.So ...
3
votes
3answers
87 views

Random numbers with a left or right biased skew

Within Java I have a table of objects ranging from horrible (1%) to wonderful (100%) from which one is randomly selected. This is simple enough and appears on a bell curve with a normal distribution ...