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

Java Collision detection

Hello have a game where you look for key cards. Which allow you to open certain doors. for example if u have a red key card you can open a red door. The problem is that when I don't have red key ...
1
vote
1answer
95 views

Java JBullet Mesh collsion problem

I have a problem with JBullet mesh collsion. Everything works fine when I create a mesh from my object without scaling, but the problem starts when I want to scale the object. I also tried scaling in ...
0
votes
2answers
81 views

Why does this simple if-statement that checks my main characters state never get called (Java/LibGDX)?

Been working on this for a while - basically I want my player to perform a front flip when he jumps (screen tap -> player jumps). I wrote the animation class Animator (extends Player implements ...
0
votes
1answer
124 views

Java, Crashing with a Shader on Intel HD Graphics

I just got a new computer (Acer Aspire ES1-311) which has an integrated Intel HD Graphics card, and I noticed that this fisheye shader crashes my game (LibGDX game, VM Crash): varying vec2 ...
-1
votes
1answer
99 views

minecraft source code for use in mods

So I am teaching a class where we will be using java to make minecraft mods. To keep things simple, we are using a third party program to set up the under-the-hood stuff for us (that way we don't have ...
0
votes
2answers
85 views

Simple LibGDX Pong game drag player instead of getting x position

I got a working pong game in LibGDX but when I touch the screen the player x automaticly jumps to the coordinates I touched. I wan't my game to detect I touched and then move the player to the ...
0
votes
1answer
111 views

Java LWJGL - How can I add water to my 3d world? [closed]

The title says it all, how can I implement a simplistic water system into my game? I am using Java LWJGL and OpenGL glsl shaders. I am still fairly new to game programming, and a complete noob in the ...
0
votes
0answers
57 views

onSignInSucceeded and onSignInFailed not called (Google Play Games Services)

Using the code below, can anyone tell me why my onSignInSucceeded and onSignInFailed callbacks are not triggered when signing in? It works fine if I extend BaseGameActivity, but when trying to extend ...
0
votes
1answer
91 views

Java LWJGL - Monster follow script not working properly

I have written a script to be set off whenever a player is within a distance of the monster. The script checks if the x position is greater than or less than the players x, and same for the z. (y is ...
0
votes
2answers
112 views

Multiplayer game principles

I am developing game using libGDX libraries . I want to create multiplayer mode , where several players can play at the same time in the same room , each player can create his own room and other ...
1
vote
2answers
129 views

How does rendering with Swing compare to rendering with openGL?

[summary: Is the performance of Swing at least in the same dimension as openGL [through LWJGL]? If yes, what percentage would you give it? What possible other problems can I expect from Swing in the ...
1
vote
1answer
56 views

Why does this impulse not affect the body?

I'm just getting started with Box2d and I'm trying to apply an impulse to a circle but nothing really happens. First I define ball: BodyDef bodyDef = new BodyDef(); bodyDef.type = ...
0
votes
0answers
13 views

How to experiment for the value of gravity in Libgdx? [duplicate]

I am following a guide on how to play a flappy bird clone in the LibGdx framework. -http://www.kilobolt.com/day-5-the-flight-of-the-dead---adding-the-bird.html I am currently on the part where the ...
-2
votes
1answer
77 views

Java game runs slower and slower as game runs longer [closed]

I know that this question may be considered off topic, but this is a significant problem. Problem: I have in a java game that I am working on. The FPS counter starts at 250 FPS and in about 2-4 ...
0
votes
0answers
39 views

Google Play Games: onSignInFailed() and onDestroy()

I just had an error while testing my game, this is an update that I'm working on and it's never done this before (and I've launched this game on various devices literally hundreds of times, so it ...
0
votes
1answer
130 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
0answers
43 views

Android View (Splashscreen) Vanishes after phone woken up from sleep

My game uses OpenGL ES 2.0 and I have a splashscreen which uses a standard Android View. This plashscreen is shown on top of the GLSurfaceView and then simply removed once everything has been loaded ...
1
vote
2answers
178 views

How do I limit the rotation speed of a mouse-following object?

I am trying to make a 2D top-down game where player controls a spaceship. The spaceship (a rocket) is just a sprite following the mouse cursor with a fixed speed and is always pointing toward the ...
0
votes
0answers
203 views

Create a Minimap of a Tiled Map with LIBGDX

thanks for stopping by to help! Having a little trouble with OrthogonalTiledMapRenderer. I've got a Tiled map that is 250x250 tiles, each 16x16 pixels. Trying to use a separate camera to draw a ...
0
votes
1answer
182 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
1answer
90 views

Java LWJGL - How can I click to interact with objects?

I want to be able to click on a monster to walk to him and start attacking him. The part that doesnt make sense to me is the conversion between the mouse position, and the actual terrain position. ...
1
vote
1answer
210 views

AI movement in 2D

I've got a prototype of a game I've been mocking up and found myself struggling to find a solution for AI movement in a 2D tile based game. Here's the issue: The player is free to roam throughout the ...
0
votes
0answers
67 views

Android: ACTION_POINTER_DOWN Called Multiple Times

I hope someone can help me here My code is below and I can't figure out why the ACTION_POINTER_DOWN case is being called multiple times (sometime twice, sometimes 4 times, but always multiple times). ...
0
votes
1answer
112 views

OpenGL 4.4 LWJGL - How can i render text to the screen

I have been told that you need to create a texture atlas for the font, and individually assign each character to a texture and add them up to create the string you want to produce. This seems a little ...
0
votes
0answers
125 views

Implementing a game loop with interpolation

I am trying to implement the Game Loop interpolated found in this website http://www.gameprogblog.com/generic-game-loop/. Here is my implementation: long frameRate = 50000000; int maxUpdates = 3; ...
0
votes
0answers
74 views

Java Slick2D Image Glow Effect

How can one achieve a dynamic glow effect in Java Slick2d? I want an image to be surrounded by a glow when I move my mouse over it for example. Example: No glow Glow Is it possible to make this ...
0
votes
2answers
157 views

Can't work with universal tween engine while having added it to gradle

I'm actually developing a game with libgdx and I'd like to create a splash screen. To do this, I must use the Universal Tween Engine. To add the Universal Tween Engine, I followed the instructions of ...
0
votes
2answers
71 views

Adjust bitmaps according to screen ratios on android

I always thought that pixels were square... it turns out i'm wrong, and I am quite worried by this. This means that if I draw a circle, it will be round on my screen but it could be an ellipse on ...
0
votes
2answers
124 views

How can I end my game when the right character statistics get to 0?

I'm creating a text-based RPG game. In my game, a player has five different stats, which might decrease over time as the player does certain things. public static int HP = 100; //CHARACTER ...
2
votes
3answers
232 views

Generating 3D-like effect

I'm making a 2D sidescroller game and want to give the blocks a 3D like effect. This way it looks like the player is walking on 3D blocks while walking on a 2D plane (thus having only x,y ...
0
votes
1answer
123 views

Why table in libgdx game give wrong position

Can anybody guide me, I am creating a table in libgdx game on menu screen to set different buttons on my screen. here is the code for table draw table.setBounds(0, 0, Gdx.graphics.getWidth(), ...
0
votes
1answer
67 views

Is the standard collision detection in Slick2D too heavy for broadphase?

I was wondering two things about the built in shape detection of Slick2D. When executed on a lot of shapes, how performant are the intersects and containsmethods, and what kind of algorithm is behind ...
0
votes
0answers
76 views

Google Play Game Services Logcat warning

I'm getting the following warning in my LogCat output. I have implemented Google Play Games Leaderboards which, after some research, it appears this warning is related to.... I would point out ...
2
votes
1answer
119 views

VBO -> How should it be done?

I'm very new to OpenGL/LWJGL. I'm reading a lot of VBOs. I'm sorry if I can't concretise my concern, but i'll try it: Why should I use VBOs? Whats the difference between using VBOs and glBegin() ...
0
votes
0answers
149 views

Android: Asynctask causes ANR (very) intermittently

I'm doing some work on an AsyncTask (creating game objects, loading resources etc) while displaying a static splashscreen. The problem is that every now and then, the AsyncTask doesn't run and the ...
0
votes
1answer
130 views

How do I calculate the bounce vector of a ball hitting the starting point of a segment?

I have a ball (with parameters x, y, radius) that travels on the screen (with vectors directionX directionY) and can collide with a segment with random slope (with parameters startX, startY, stopX, ...
0
votes
2answers
426 views

Resizing a Framebuffer Object (ie: its attachments) on Screen Resize

I have been experimenting with some post-processing effects and I have been using FBOs to store stuff. The problem is, I attempt to resize them when I change resolution. I get no errors, however the ...
7
votes
5answers
2k views

How can I mark levels as “complete” in a way that prevents cheating?

My first thoughts about marking levels complete is to just write the information to a file upon level completion and load that in once the app is opened up again. But how could I keep this safe from ...
0
votes
1answer
37 views

Slick2D Graphics Misaligned

I'm working through a game in Slick2D and am now focusing on a lot of the graphical end. It's going pretty well other than a couple of issues with alignment. An image illustrating both of these issues ...
2
votes
1answer
182 views

Libgdx Actions interpolation Fadeout

In libGDX there is a simple fade Interpolation that speeds up towards the end of the action animation. But what I am looking for is the reversed of it, it needs to start fast and slow down near the ...
0
votes
1answer
254 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
1answer
192 views

Move Box2D body towards mouse click

In a top down game using Box2D, I would like the player's Box2D body to rotate towards the mouse click, and then move to a point on mouse click (move, not teleport). I have worked out the rotation ...
0
votes
1answer
289 views

Organising data of a turn-based strategy

I'm intermediate in Java but novice in everything which is on the server-side. I've set myself a task to rewrite an old game, so learning Java is more fun. It is a space turn-based strategy. The ...
1
vote
1answer
45 views

Why is the Hiero font not coordinated to fit neatly in the display window?

I imported a font with Hiero and I draw the font like: font.draw(batch, "1", 0, 48); This is the resultant image: So the font it moved up to hit the bottom perfectly, but it doesn't touch the ...
0
votes
1answer
66 views

How to detect if players alter game files and stop them from entering the game server [duplicate]

as the question says. how can i check if a player modifies a file such as maps or spells in my rpg games that will be located as "/cache/spells", "/cache/maps" or "/cache/entities" and you get the ...
0
votes
1answer
80 views

How to Render an xml tile grid in java [closed]

So i decided to write my games data files in xml since a lot of people recommend it security wise for an online game, but how exactly does one render an xml tile grid in java? format will be as ...
0
votes
1answer
81 views

Slick2D re-starting particle system/emitter

I am trying to use a particle system/emitter in Slick2D to produce a thrust jet from a space ship. I can get the emitter running continuously without any problem, however I can't get it to run for a ...
0
votes
1answer
119 views

glVertexAttribPointer stride ambiguity

As a hobbyist junior game programmer, I have done multiple small OpenGL projects just to have fun with 3D. I've tested VBOs in C++ and in Java and I found something or rather understood Java tutorials ...
1
vote
1answer
86 views

Synchronization with game tick

I'm working on a multiplayer game and it's currently set up like this. It accepts packets from the client on the fly and does whatever processing it needs to. There is also a main game tick which is ...
0
votes
0answers
21 views

Intermediate AI for Java games [duplicate]

I want to know how to create good AI for a Java game, I'm still learning the language and I'm not an expert. I can do static AI but wanna know about writing an AI that follows the player and ...