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
2answers
55 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
227 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
139 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
181 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
22 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
51 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
53 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
40 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
48 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
47 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
68 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
69 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
105 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
48 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
63 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
50 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
22 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
231 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
119 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
238 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
49 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
72 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
27 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
91 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
45 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
52 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
31 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
27 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
34 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
168 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
24 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
51 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
42 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 ...
3
votes
3answers
121 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 ...
-5
votes
1answer
69 views

How can I make a world? [closed]

I'm making a game, and have the screen done. but now, I want to make a world. But I don't know how to make the world larger than the screen. My screen is 800x600, I want the worldsize about 3x that.
3
votes
1answer
87 views

LibGDX: Is it necessary to set a stage as an input processor when creating a touchpad?

I mean, I've been searching it, they always use set a stage as an input processor after they had added the Touchpadto the Stage because it extends from Actor indireclty(it extends from Widget that ...
0
votes
1answer
41 views

LibGDX: how to implement 2 cameras in a unique stage

I am quite new to LibGDX. I am trying to make a game, where the character is an Actor, and it's controlled by a Touchpad(included in the main Stage as an Actor too). My problem is that I am trying to ...
0
votes
0answers
17 views

Disable buffer swapping in LibGDX

Is there a way to disable buffer swapping in LibGDX every time the "render" call of ApplicationListener returns? I mean - I'm looking on some way to be able to tell the framework if I want the buffers ...
1
vote
1answer
225 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
0answers
73 views

“Choppy” visual of game

I'm using interpolation to move objects on scene smoothly and in same speed. But in reality it looks like they are not moving smoothly - it looks like as game is running at 15 FPS or something like ...
0
votes
0answers
58 views

2D Voxel Game Chunk Question

I'm currently working on a 2D Voxel game. I started with a big blocks array with all blocks inside it, but it is not very good for performance, so I'm currently switching over to chunks. My question ...
0
votes
0answers
15 views

Java keyListener animating bufferedImages

I am making a game similar to a photo scramble/unscramble game which requires the use of keyListeners. I set up the logic but when I code the animations, they just sit there and do nothing and ...
-1
votes
1answer
63 views

Java Move towards point

Ive made this 'game' where you can fire an aibility (a fire ball for instance) from the player towards the mouse (to the point where the mouse was at the time of casting/fireing/shooting the ball), ...
0
votes
1answer
281 views

How to use Java 8 with Lib GDX in IntelliJ?

I have set the jdk to Java 8 and I have modified all the build.gradle files in my project to have sourceCompatibility = 1.8 instead of 1.6. My problem is that while it does work on Desktop it doesn't ...