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
40 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 ...
0
votes
2answers
38 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
votes
1answer
58 views

How to resize 2D Java game without “squeezing” it?

I am trying to make my second java game (2D) but i have run in a problem: The game will be in fullscreen, but how can i make it so it is scaled properly for each screen? While researching i found out ...
0
votes
1answer
18 views

InputProcessor without stage

I have a GameScreen where I'd like to have a pause button. I've tried using an Image with a listener, but since my GameScreen isn't a stage, I can't use that in the inputProcessor. So my question is ...
3
votes
2answers
123 views

Rotate sprite along the angle between two objects

Im trying to make flames follow my object, I set the direction for my moving object using the points between it and another object (using static destination for testing). No matter what I do I ...
2
votes
0answers
51 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 ...
0
votes
0answers
18 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 ...
-2
votes
2answers
288 views

How can I display an image for a predetermined amount of time?

I want to display an image, then return to the previous after one second when a certain key is pressed. I'm using Slick2d and Java. How can I accomplish this?
0
votes
0answers
27 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 ...
2
votes
1answer
96 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
1answer
31 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
0answers
24 views

LWJGL Not Rotating Properly

I'm 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
0answers
11 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 ...
3
votes
1answer
93 views

2D Map Editor Tiles Palette - Best suited Java Elements to use?

I'm making a 2D RTS Map Editor and here came the moment to make a Palette which is just a popup frame showing tiles to be clicked on and then applied on the map. I'm wondering which Java Elements to ...
0
votes
1answer
27 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
159 views

LibGDX - how to detect touchUp with GestureListener?

I'm making a game and I have implemented GestureListener as my inputprocessor. It came with a bunch of methods such as fling, pan, tap etc etc including touchDown. However, there is no touchUp method! ...
0
votes
0answers
16 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: ...
0
votes
1answer
65 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
34 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? ...
0
votes
0answers
47 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 - ...
0
votes
0answers
11 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
1answer
24 views

Problem with JFrame? [on hold]

So I'm not sure why (because this didn't use to happen before) but once I run my program the JFrame appears but then it waits 1 or 2 seconds before it draws anything to the screeen. So basically for ...
0
votes
0answers
34 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
0answers
34 views

Collision LibGdx

Shape 1 is falling. I want Shape 2 to land on Shape 1. Shape 2's gravitational movement gets choppy after adding if(Shape1.collides(Shape2.getBounds())){ SHape2.Collide } and it ...
3
votes
3answers
377 views

Fastest 3D bounding box algorithm

I am at the point in my game where I need to add a collision system. I tried jBullet, and while it did work, it wasn't what I was looking for. I just want a simple way to test if two oriented bounding ...
0
votes
1answer
87 views

Libgdx Fine Tune Megaman Movement

With help from my last question, I was able to fix the issue of having a stuttering effect if you keep hitting jump, while jumping. I believe I have managed to match moving on the X axis and the ...
0
votes
2answers
1k views

libgdx actors and instant actions

I'm having trouble with actors and actions. I have a list of actors, they all have either no action, or 1 sequence action This sequence action has either : a couple of actions (some are instant, ...
0
votes
1answer
66 views

Positioning partials of character sprite animations

I'm not entirely sure how to best explain what I'm doing. Maybe I'm going about this completely the wrong way. If any of you find that that is in fact the case, I would appreciate it if you told me ...
0
votes
1answer
48 views

Java multiple player objects/enemy objects?

NOTE: I'm a beginner and learning :D Alright, so in my game I have a class for the player (with the parameters of x, y, color, width, height, and health, same parameters with the enemy). But I have a ...
2
votes
2answers
351 views

Filling in 3d Shapes

For a college project I need to draw an empty cube and then show the cube being filled. So far I have heard that JME and voxels is the way to go but I have no idea where to start. Can anyone point me ...
0
votes
2answers
67 views

Java Slick2d image depth/layering

Im making a topdown 2d game, and I've made a decent entity system so far. But I want to do the following with it: I want to have drawing depth, so if a , for instance, tree is above another tree then ...
0
votes
1answer
115 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 ...
3
votes
1answer
63 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 ...
-1
votes
0answers
36 views

JPanel vs Canvas? [closed]

The reason I'm asking this is because in the tutorial I'm following it uses Canvas but and in a section it goes like this: BufferStrategy bs = this.getBufferStrategy(); followed by Graphics g = ...
0
votes
2answers
95 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
vote
1answer
324 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 ...
-1
votes
1answer
64 views

Game puzzle pop in java [on hold]

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 ...
6
votes
1answer
90 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 ...
3
votes
1answer
368 views

Setting Window Icon Using GLFW (LWJGL 3)

What's the best, cross platform, way of setting the window icon using LWJGL 3? I have a PNG image and would like to set it to the icon present in my dock (OS X) or the application bar (Linux).
2
votes
1answer
1k 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 ...
0
votes
0answers
25 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 ...
4
votes
2answers
159 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 ...
0
votes
2answers
69 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
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
23 views

Random distribution of chess pieces (Chess960/Fischer Random Chess) [closed]

I am new to Java(2 weeks training only) and tried to create a simple Java game and implemented an AI. Learning Java all by myself, I followed a few guidelines online and have come up with something ...
0
votes
1answer
448 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 ...
1
vote
1answer
45 views

How to dispose in Newest Java/LibGDX ApplicationListener?

Am I new? yes What I'm wondering: How do you dispose of textures / spritebatches and the things you normally need to dispose of now? Why I'm asking: Because theirs no automatic dispose() function ...
2
votes
2answers
145 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 ...
2
votes
1answer
383 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) { ...
0
votes
1answer
37 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 ...