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

How could we use trigonometry for moving around a 3D World?

Well I have a question about geometry and 3-Dimensional player movement in general. I'm using Java, OpenGL and LWJGL. This is basically what I got: currentFrontSpeed: Is a float that contains the ...
1
vote
0answers
59 views

Moving box2D body with texture?

I was following the solution from this http://stackoverflow.com/questions/20180063/box2d-body-with-texture. I ended up getting this working for static bodies. But when trying to get the PolygonSprite ...
1
vote
1answer
97 views

Make game camera stay inside of tiled map boundaries [LibGDX]

I am creating a little 2D platform game, with the LibGDX framework. So far I have created a simple prototype level in Tiled, and loaded this map into my LibGDX game. I can use mouse and keyboard ...
2
votes
2answers
86 views

Circle to Polygon collision response

I'm working for collision response for my 2d game. Character is represented by circle and obstacles are represented by Polygons(in my example it would be rotated rectangle for simlification). The ...
0
votes
1answer
68 views

Image rendering with additional space around it

When I try to display an image that is 400 pixels wide and 800 pixels high, it is not displayed this way. Instead it is diplayed like this: Instead it is displayed like this You can see at the bottom ...
1
vote
1answer
54 views

Admob - gradle configuration error

I've followed this tutorial https://developers.google.com/admob/android/quick-start, but I'm stucked at gradle configuration. I've added line compile 'com.google.android.gms:play-services-ads:8.3.0' ...
0
votes
0answers
31 views

LWJGL 3 GLSL normal problem

I have a pretty strange problem today. I started to make a 2d game yesterday, and everything was right until now. I wanted to make a lighting system, wich required me to send the vertexnormal from ...
0
votes
0answers
67 views

How to dynamically draw a filled polygon with a given array of vertices?

Say I have a simple array of vertices (or floats with every odd index being the X of a vertex and every even being the Y), how could I paint all the area between the vertices? As in, I have maybe ...
0
votes
0answers
51 views

LibGDX Scene2D.UI without Scene2D?

I'm currently programming a little game in LibGDX for which I planned to use Scene2D's UI aspects to make menus and a hud. When fiddling around a bit, I noticed that my Scene2D.Stage basically made ...
2
votes
1answer
75 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
74 views

Aspect ratio of drawn quad messed up after rotating

When I draw a quad that is rotating the aspect ratio of the quad gets messed up and the size changes. Gif of what is happening I am confident it has something to do with the way I calculate the size ...
0
votes
2answers
54 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)
0
votes
0answers
167 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
3answers
134 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) ...
5
votes
2answers
171 views

Predicting Enemy Movement

Well I have a simple 2D game where all positions are defined by and X and Y coordinate. There are objects moving at a constant velocity. And a turret fires a bullet at the X and Y coordinates of the ...
0
votes
0answers
21 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
vote
1answer
50 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
1answer
52 views

Repaint() in gameloop does'nt work [closed]

Recently I'm working on a PAC-MAN clone. I created 3 classes: StartingClass which extends Jframe and uses KeyListener Board which extends Jpanel Sparx which is responsible for changing the ...
1
vote
0answers
36 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
1answer
47 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
1answer
36 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
62 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 - ...
3
votes
1answer
40 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
31 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
1answer
67 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: ...
4
votes
2answers
103 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
0answers
28 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
44 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
0answers
59 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 ...
0
votes
1answer
39 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
21 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
219 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 ...
0
votes
0answers
31 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
2answers
114 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 ...
3
votes
2answers
206 views

Profiling LibGDX game with GLProfiler

I am trying to profile my LibGDX game, It runs on 60FPS on PC and 42-45 FPS on MY mobile phone. Either I improve performance and raise it to 60, or lock it at 30 (I don´t want to do this). I have ...
1
vote
1answer
45 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 ...
4
votes
2answers
71 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); ...
1
vote
0answers
26 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
1answer
61 views

LibGDX - How to export a texture as a .png onto, say, the desktop

I'm making a game in which I need to export a texture which the user has edited as a .png into a specified location. I'd like it if I could have the default saving window thing (like on other apps ...
1
vote
2answers
40 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 ...
1
vote
1answer
46 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 ...
0
votes
0answers
29 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
23 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
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
30 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
1answer
438 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 ...
6
votes
2answers
166 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 ...
0
votes
0answers
23 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
50 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
39 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 ...