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

2D Collision in tilemap - ArrayOutOfBounds

im trying to do collision detection with world based on tilemaps (two dimensional array) array - private int WIDTH = 10; private int HEIGHT = 6; String[][] simplemap = new String[][]{ { "0","1"...
0
votes
1answer
54 views

Bouncing Balls in angular movement

I'm trying to bounce a ball off of a wall based on angular movement. The ball comes in at angle X ( lets say 30 ). Bouncing off with the equation 360-ballangle works for the left and right walls 180-...
0
votes
1answer
64 views

How to handle interaction with the map in a 2D-RPG-typed TileMap?

Sorry if this is a long post, but I'd like to explain the context before asking my question ^^" I'm currently working on my "first" game (the more advance one, at least). It'll be a 2D-ARPG where the ...
0
votes
0answers
31 views

Paint objects cause lower FPS by time

I'm creating squares on XML layout with Paint, you can see how exactly bellow: public class PaintObject extends View { Paint paint; public int x; public int y; public PaintObject(...
0
votes
0answers
20 views

Box2d Body filled with a texture Libgdx

I have a simple triangular shape (obstacle) in my game and i would like to fill it with a texture repeatedly. I have looked at the other 2 topics but couldn't find a working solution. How can i fill ...
0
votes
1answer
34 views

LIBGDX: Translate grid drawn with ShapeRenderer with an OrthographicCamera

I am trying to draw a grid for my "world" that may or may not extend beyond the screen. What I would like to do right now is draw the entire world (which is relatively small) and then use the ...
1
vote
1answer
50 views

Categorizing Projectiles in an arcade shooter (multiple inheritance?)

I have been working on a simple arcade shooter in Java in the vein of missile command/space invaders. I've made a base Projectile class and have been extending other Projectile types from it. This ...
0
votes
0answers
20 views

Problem with automatic ragdoll shape generation using Bullet

I'm trying to automatically generate ragdoll colliders (for now, box colliders) from my mesh. First of all, I specify the body parts like so: ragdoll.setRagdollBone(Ragdoll.RagdollBodyPart....
0
votes
0answers
38 views

Decrease force in a zero gravity world

I have a world with zero gravity. On a mouse pressed I apply a force so things drive away from the mouse. The problem is now that they keep on flying. How can i make them stop? box2d.world....
0
votes
1answer
75 views

Drawing bullets on a map

I'm going to be making a shooter-style game, on a navigatable map (All 2D). I'm a little unsure of how to handle the bullets: I see two main ways i could do it I could have the bullet's x and y ...
0
votes
0answers
12 views

JPopUpMenu in JAVA using swing

I am working on a java application, i just added a popup menu on JTable, evrything work just fine but when i click inside a cell to edit it's content and click back out side and then when i try to ...
0
votes
0answers
35 views

Removing no longer used paint out of screen

I have Paint, like this: Paint paint = new Paint(); paint = new Paint(Paint.ANTI_ALIAS_FLAG); paint.setStyle(Paint.Style.FILL); paint.setStrokeWidth(5); paint.setColor(Color.BLUE); and I'm drawing ...
0
votes
1answer
60 views

How to apply Buoyant force to a Box2d body?

I have been following a formula to calculate the buoyant force needed to apply to a dynamic body to be able to simulate water. Fb = ρgV Fb - is the buoyant force ρ - density of the liquid g - ...
3
votes
1answer
88 views

Just how expensive is it to bind textures in OpenGL? (LibGDX)

I'm using LibGDX on top of OpenGL and currently my game engine does something along the lines of the following per frame Bind a terrain texture sprite atlas and a set of transparency masks in ...
0
votes
2answers
106 views

Java, spawn algorithm that gets harder each level

I am currently in the process of making my 3rd Java game (everything I have learned is from YouTube videos, so I may be doing some things wrong) named "Blocked". But I have run into a problem: how do ...
-1
votes
1answer
73 views

Game puzzle pop in java [closed]

I am making a game in Java based of those puzzle popping games. The objective is to select with the mouse and remove a tile. The game i want to build. I have a JPanel and on top, several Components, a ...
0
votes
0answers
35 views

How can the new Yggdrasil Minecraft authentication be utilised in java?

A while ago I had a custom launcher for my modpack in minecraft and it used the old login.minecraft.net method of authentication but now I see they have changed this method. Here is a link to the new ...
0
votes
2answers
84 views

How is it possible to call abstract methods from another class? [closed]

Im creating a game using LWJGL and just as a bit of organising I made an Abstract class called Game so I could extend Game in my main class The game class is like so - public abstract class Game { ...
0
votes
1answer
46 views

How do I fix a delay between the first and second KeyEvent

I recently got really interested in making my own little game. As I have no real game development background I'm still figuring stuff out, but I encountered a little problem. While working on the ...
0
votes
1answer
51 views

How to export slick2d game into a jar with the res and native folder

I am a beginner in Slick2D. I use jarsplice to output Slick2D game. But it is export all thing into one jar. I want to export one jar with the res and native folder .... So I can easily modify ...
0
votes
1answer
45 views

TliedMap render use 15%cpu

I am a beginner in Slick2D. I used TiledMap render in my game,but I do not know why it use 15%cpu and how to fix it. I used map is 1024*768. This is a part of my code. Thanks for any help public ...
0
votes
0answers
31 views

LWJGL Not Rotating Properly

I am trying to make a Rubik's Cube in LWJGL but the specific pieces don't seem to be rotating correctly. The original without any rotation is fine. After one rotation: This is also correct but the ...
0
votes
1answer
35 views

Random black screen when changing states

I'm making a game with LibGDX but I ran into a really odd problem. When I was working on the loading screen I delayed the loading process with an image of ~87MB. When the loading is finished, it ...
0
votes
1answer
29 views

Libgdx - changing tiledmap smoothly, Tween engine maybe?

First question here, so bare with me if I make a mistake or two. Long story short I'm currently developing a side scroller game in java with libgdx, which uses tiledmaps from the tiledmap creator ...
0
votes
1answer
20 views

LibGDX - Shader not being applied

I've recently encountered a strange problem with my program and I can't seem to fix it. When I try to apply a shader to my SpriteBatch it doesn't change. I've debugged this problem like so: if (test) ...
1
vote
0answers
56 views

What is the most efficient way to store world data for a 2D tile game? [closed]

I'm working on a 2D tile based survival game for my programming class and as I was working on GUIs I realized that I would need an efficient way of storing and recalling not only the tile data and ...
1
vote
1answer
64 views

How to jump in Box2D with LibGDX

I am making a 2D platformer in LibGDX with both Ashley and Box2D. I have it so, that the PlayerControllerSystem watches for the jump key being pressed: // Jumping if (Gdx.input.isKeyPressed(...
4
votes
2answers
189 views

Poor performance wth custom particle system in LibGDX

I'm using a custom particle system for my LibGDX / Java based game project (because I used Slick2D earlier on, need more parameters so I made my own and then ported). The system is fairly standard as ...
2
votes
0answers
62 views

How can I connect multiple explorable regions into one large map?

I am planning a 2-D science fiction game involving spaceships. A major thing that I am having trouble figuring out is how to create a 2-d array of smaller maps that the player can explore. My ...
3
votes
2answers
139 views

How do i implement a hit box system in a fighting game?

In a fighting game a move that you execute is basically just a series of hit boxes that are enabled and disabled at certain times. I want to know how do you create this hit box system. I have no idea ...
0
votes
0answers
33 views

HorizontalScrollView with multiple views in one “frame”

I have ImageButton, with TextView and ImagaView inside it. I have six of these. So I want to implement them into HorizontalScrollView. I remember I had one HorizontalScrollView with images some time ...
1
vote
1answer
40 views

Java- Trig based movement

I have been trying to create a smooth movement technique that would allow me to move in all directions, not just the 8 cardinal directions. I have tried to use this doing trig, and while the ...
7
votes
1answer
101 views

Perspective-Correct Texture Mapping

I am working on a small rendering engine for a personal project and I am having issues with the texture mapping part of it. It seems to work for some cases, but not for others. For example, when one ...
1
vote
1answer
40 views

Libgdx black rectangles problem

I'm working on a game for Android using Android Studio with LibGDX in Java. I recently found a weird problem when closing and reopening the game. When I first open the game, it works fine. If I click ...
0
votes
1answer
30 views

Position of an object relative to another in a 2D plane

I have two objects, A and B, each of them has a set of coordinates (x,y). How do I understand where is A in relation to B's position? If I where to just check each coordinates I could do it like this:...
0
votes
3answers
90 views

LibGDX simple button with image

I want to make two image buttons (play, restart) in my main menu screen but I dont know how to do it. I tried this: Texture playTexture = new Texture(...) Image playImage = new Image(playTexture) ...
1
vote
1answer
69 views

How do you create a funky moving background?

I'm trying to create something similar to what you would see if you loaded a song in Windows Media Player (the cool abstract background that moves and produces various colors). I have no idea how this ...
4
votes
1answer
156 views

RAM usage unusually high, but CPU usage relatively low

I've created a relatively simple game using libgdx, but the RAM usage when I start up the game on my Android device is roughly 600-700 mb, but the CPU usage is only about ~0.05%. I've downloaded a ...
0
votes
0answers
16 views

Actions.fadeOut doesn't work when called on stage root

I'm trying to fade out my screen when a button is pressed, but the following code doesn't work: public void switchScreen(final Game game, final Screen newScreen){ stage.getRoot().getColor().a ...
-3
votes
2answers
82 views

Is it possible to use Java as a scripting language in unity? [duplicate]

I wonder if its possible to use Java as a scripting language in unity to create a basic 2d game?
2
votes
1answer
72 views

Anti-Aliasing Problem

So, I was annoyed by how the HUD for my GameState was very pixel-ated and I wanted to change that through the use of anti-aliasing. However, it works with a small exception: It adds all these lines ...
0
votes
0answers
32 views

How could I add XBox 360 Controller handling support to my game?

The title says it all. I'm making a 3D Open World game with OpenGL and LWJGL in Java, and I really need to move in several angles to fully feel inside the game. The problem is that I couldn't find any ...
0
votes
1answer
57 views

onHold input libGDX

I want to have onHold or onTouch input for my game. So as long as the user touches the screen something happens (a car moves) and when he stops touching the screen it stops. How do I do that? I want ...
0
votes
0answers
17 views

Libdgx and Overlap2D export settings for Android

So I have a problem when exporting assets from Overlap2D to Android Studio project location. When setting up libgdx I set the project to be for desktop and android and selected Overlap2D extension. ...
0
votes
1answer
83 views

How does one structure a Player GUI

I am using Java and the Slick2D library. I've been testing around with ways to develop a Player Graphical User Interface (GUI) (to show armour, items picked up, weapons equipped, etc). The one ...
0
votes
0answers
6 views

LibGDX Child node is not following animation

So I'm trying to place a golf club as a child node of the hand of our "golfer", so it follows the animation the golfer has when the animation is invoked. However, once I hit "Check Swing" (the button ...
0
votes
0answers
25 views

Making my game scalable? [duplicate]

I'm quite new to games development and just recently I've made my first Java platformer. I've been using Graphics2D to draw my spritesheets, but I've heard this method isn't very good in terms of ...
0
votes
1answer
69 views

Network interpolation wont work for local player

im currently developing a little duengon crawler. It should have lan multiplayer and it works great but i think im sending to much packets. Should i send packets over network, when a player moves in ...
0
votes
0answers
68 views

Multiplayer through blocked Firewall Ports?

im currently trying to develop a little game. I thought it would be a great idea to implement coop multiplayer, only lan. So i took kryonet and created a server. On my home wlan it works great im able ...
0
votes
0answers
64 views

How to update projectile trajectory point?

I am a new game developer, I am making a game, but I have a problem, I don't know how I can update my trajectory point in OnDraw method. Could anyone please help me? Thank you! Here is my code: ...