Java is both a popular 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
383 views

Wall jumping collision detection anomaly

I'm creating a game where the player ascends a tower by wall jumping his way to the top. When the player has collided with the right wall they can only jump left and vice versa. Here is my current ...
0
votes
0answers
4 views

JBullet Only Updates Position when I update it in Code

The title is a bit weird...but here it goes: I have JBullet configured so that I can move things in my code, as the game tick structure is something like this (the update code located in ...
0
votes
1answer
33 views

JBullet move object rigidbody in code?

I am trying to move an object's Transform (of a coded class, these are for the rendering engine), then convert it into a JBullet Transform. After that, I try to apply any movement to the JBullet ...
4
votes
3answers
4k views

How can I make my main character move in a parabolic arc when jumping?

I'm entering Android game development, and I already have a computer version of a game I want to publish. The thing is, I want to make this as good as it can be. With that said, I need a physics ...
0
votes
0answers
15 views

Java - Updating Block Textures Based On Surrounding Blocks [on hold]

I am trying to make a top down game and when you play a wall, depending on the walls surrounding that wall the texture will change, it is fine until there is a loop, then i get a stack overflow error, ...
0
votes
1answer
34 views

How to add a callback to addAction in scene2d

Sorry if this is a newbie question, I'm still learning libgdx. I'm using scene2d and I am trying to fade a tooltip into my scene and fade it out after 4.5 seconds. Everything is working in my code ...
0
votes
0answers
20 views

(LibGDX/JAVA) How can I get a rectangle to rotate with this pendulum so I can start detecting collisions?

One of the objects in my game is a pendulum that swings in a semi-circle. This is done by having an update() method like this: public void update() { angleAcceleration = +1.81 / length * ...
0
votes
0answers
21 views

Sprites not being rendered on screen change - Android Libgdx

In my game over screen for my Libgdx Android game I've the following code which starts a new game upon a screen touch. if(Gdx.input.isTouched()) { ScreenManager.setScreen(new ...
1
vote
2answers
647 views

Matrix rotation wrong orientation LibGDX

I'm having a problem with matrix rotation in libgdx. I rotate it using the method matrix.rotate(Vector3 axis, float angle) but the rotation happens in the model orientation and I need it happens in ...
0
votes
2answers
158 views

Basic 2d platform collision detection algorithm has a slight bug (Java)

I'm trying to implement collision detection between Player (the main character) and a Platform. They are both modelled as rectangles; when player hits the side of a platform he should bounce off it ...
1
vote
1answer
52 views

How do I make my main character move towards an object? LibGDX/Java

What I want to happen is for my player to bounce from spring to another. For example take the illustration below: Here's my code (what I've tried to do so far). This gets called in an ...
0
votes
1answer
39 views

Game lags when my player collides with a specific object (solution known, unsure how to implement)

I'm developing a game in Android using LibGDX (although this is more of a JAVA problem than an engine problem). My aim is to have my player bounce off one spring onto another that will eventually take ...
-1
votes
1answer
31 views

Scrolling is going too fast

I used delta based off the LWJGL tutorials and it works (I get 16 or 17 delta) but everything is scrolling nonstop. Here's how I render things: public class Game { int camX; int camY; ...
0
votes
0answers
22 views

Java how to check if a block is beside a block [on hold]

Hello I have a game where you build vehicles. I want to be able to drive and fly these vehicles around the place. All vehicles must have a cockpit. I want to be able to check which blocks are ...
0
votes
0answers
14 views

Android: How to scale the imageView?

Right now my application allows the user to double-tap a bitmap image and a circle is drawn exactly where the user double-taps. Now I want to implement a button that can resize the circle that is ...
1
vote
0answers
13 views

LibGDX Tiled Map - how to get embedded objects

I am using LibGDX to learn Game Development. I have reached the phase I am learning to use Tiled Maps. In Tiled map editor, there is a feature where we can pick a tile in the tile set, go to View -> ...
0
votes
1answer
26 views

LWJGL 3, VAO and Shader not rendering [on hold]

X-post from Stack Overflow because its receiving little attention. I am using LWJGL 3 and Shaders with VAO's. My current implementation does not draw the VAO when using the shaders. However the VAO ...
-1
votes
0answers
12 views

Sequential Memory Game, Incrementing Images Showing all at Once not One at a Time

I am making a sequential memory game, each time a user gets the sequence correct an extra image is added to the sequence. The problem I am having is all the images flash at once not one at a time. For ...
0
votes
1answer
24 views

Java OpenGL Perspective matrix not working

I'm trying to render a simple triangle with OpenGL in Java using LWJGL3. Everything is working great, but the projection matrix (perspective) is not working. In C++ I just used to apply the ...
1
vote
1answer
39 views

Is there any case to mix Android UI with LibGDX?

my question is about creating "non-playable" screens in games with the help of native android tools. For example, I have an Android LibGDX game (singleplatform), what should I use to provide start ...
0
votes
1answer
91 views

Libgdx box2d crashing

im making a game in libgdx which i having a bunch of circle bodies floating around in space and when the player's body crashes into another body, that body deletes and creates two smaller bodies ...
-1
votes
1answer
12 views

libGDX's 2D particle editor launching incorrectly

What's going on? Here's my process: I first right-click the referenced library for gdx-tools.jar in Eclipse: I then search for the particle-editor class: It opens successfully, but half of the ...
0
votes
0answers
39 views

Java game check if any of the booleans are true? [on hold]

I have a game where you place blocks. At the moment you can place blocks on blocks I don't want that. In the listen class I do if(canplacetile){ createtile(x,y); } In my main ...
-2
votes
2answers
75 views

Minesweeper number placement [closed]

My professor gave us a project: make a minesweeper clone. However, he said that he will give bonus points for the 3 fastest algorithms for board generation. I'm currently doing the algorithm that ...
0
votes
1answer
34 views

Client code handling its own generics when returned by an engine

I'm writing a game engine in Java 8, and have prototype client code written in Groovy. New Game objects can be created with a builder which defines everything which fills in the blanks. To simplify ...
0
votes
0answers
7 views

Libgdx - How to change GestureListener pan finger sensibility?

I implemented GestureListener in my Overlap2dStage to pan the camera when the player drags its finger over the screen. But I also have some actors that extend InputAdapter to detect when the user ...
1
vote
1answer
36 views

(Java) Trying to animate an arraylist of coins with a (working) animation class

I have a coin class which takes in an integer numOfCoinsand an enum LayoutType, which can be linear or curved. A linear layout displays the coins in a straight line one after the other - we'll work ...
-2
votes
0answers
31 views

Java how to not place a block on top of another block? [closed]

Hello I have a game where you build ships you place blocks by left clicking your mouse. Everything works great in this game except you can place tiles on top of other tiles and I don't know how to ...
0
votes
1answer
100 views

Java Game How to find the x and y for a tile?

Hello I have a java game where you build houses I want to be able to dag my mouse form point a to point b and I want to fill that area with tiles when I release the mouse. What I cant do is get the ...
1
vote
1answer
161 views

How do I reverse this 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, ...
0
votes
1answer
136 views

Client side latency when using prediction

I've implemented Client-Side prediction into my game, where when input is received by the client, it first sends it to the server and then acts upon it just as the server will, to reduce the ...
3
votes
2answers
285 views

How could I implement 3D player collision with rotation in LWJGL?

I have a problem with my current collision implementation. Currently for player collision, I just use an AABB where I check if another AABB is in the way of the player, as shown in this code. (The ...
6
votes
3answers
1k views

Is it possible to implement Steamworks functionality in a Java game? How?

I have a basic game that I want to eventually turn into something better. The game is all Java as of right now, but I want to implement the Steamworks SDK into my game (so it can have achievements, ...
0
votes
0answers
47 views

Shooting game collision detection [closed]

I am making a space shooting game. I have a player controlled spaceship, enemy spaceship and bullets, and maybe some additional interact-able entities. How should I handle collision detection? Should ...
1
vote
0answers
29 views

Using Box2D in LibGDX, is there a reason a fixture set to be a sensor would only -sometimes- detect a collision?

I am working on a 2D game in LibGDX. Currently, I am testing interactions between a player's weapon and enemies - in particular, a sword and an enemy monster. The player has a hurtbox and the sword ...
0
votes
1answer
90 views

Creating a separate renderer for entities in a 2D game

I'm making a 2D shooter game. As of now, every entity "draws itself", meaning every renderable entity has a draw function. I know it is better if rendering is handled separately, but how can I achieve ...
0
votes
2answers
74 views

How do I show damage to an enemy? [closed]

I have a Player and an Enemy, both with damage values and health. I am trying to add something that will show how much damage is done to the Enemy with each attack. I want it to show above the Enemy, ...
0
votes
2answers
209 views

LibGDX how to change animations

I have a Player Class and i have 3 different Animations for it. I can render them perfectly but i don't know how to change from one animation to another. For exmaple i have 3 animations, one for ...
0
votes
2answers
889 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
196 views

Android Game-Loop (rendering & logic removed, but still 'skipping frames')

Overview Guys really hopeing for some help here. My game loop is based on code from Fix Your Timestep!. I've read the article more than a few times, but I can't quite work out what exactly is ...
0
votes
2answers
875 views

Java collision detection and player movement: tips

I have read a short guide for game develompent (java, without external libraries). I'm facing with collision detection and player (and bullets) movements. Now i put the code. Most of it is taken ...
0
votes
0answers
45 views

Trouble with Raycast Selection using OpenGL

I am currently having trouble with a custom model editor in which I want to implement model selection (eventually featuring face selection to have something like "click-and-drag" to extend the cubes). ...
2
votes
1answer
686 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
1answer
111 views

Multiplying by delta not giving smooth movement

I started working on my first proper game but reached a problem straight away. In short I have a game that runs most of the time at 60 fps. ( I am using Libgdx a popular Java framework) but my game ...
0
votes
0answers
19 views

Java Slick2D rotating a Shape using transform(Transform.createRotateTransform())

I have spent most of the day trying to debug this tiny piece of code, and I can't for the life of me figure it out. I'm making a pong game for the Mini Ludum Dare currently going on. I am programming ...
0
votes
1answer
27 views

LibGdx Table not firing touch events

I can easily add listeners to the actors within a table, and they will fire events, but if I want an entire to table to have 1 listener and do not care to have differentiated effects depending on ...
0
votes
1answer
50 views

Animation fails due to a NullPointerException which I'm certain shouldn't be thrown (LibGDX / Java)

What the title says basically. I've been stuck on this error for a few hours I got it to work earlier but I honestly can't see why its failing now (ctrl + z'd back to the working stage). Here's my ...
87
votes
12answers
8k views

What data-type should I use for in-game currency?

In a simple business simulation game (built in Java + Slick2D), should a player's current amount of money be stored as a float or an int, or something else? In my use-case, most transactions will use ...
0
votes
2answers
162 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
0answers
11 views

Java how to fill a selected area with tiles [duplicate]

Hello this is my last try at asking this question because my other ones weren't great. I have a game where you build space ships. You can drag the mouse from one point to another and it will draw a ...