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

-2
votes
0answers
23 views

How do I use the picture with 2 images as my sprite sheet? [on hold]

Alright, I've got 2 images, and they're serperated. I've used Gimp, and there is no background, just the checkered shit that shows nothing's there. I can get it in my program, the only problem is, how ...
0
votes
0answers
8 views

LibGDX - Getting a strange error in my (simple) Animator class

public class Animator extends Player implements ApplicationListener { private static final int FRAME_COLS = 7; private static final int FRAME_ROWS = 1; ...
0
votes
2answers
30 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
0answers
47 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 ...
-2
votes
0answers
30 views

Searching for a good Code example for a Java platformer [on hold]

I am like the titel tells you, I am searching for a example. I learn by looking at things and then taking them apart, so what i need now is a well made platformer. The Platformer should feature ...
0
votes
2answers
29 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
42 views

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

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 ...
-1
votes
0answers
23 views

How to load UV texture from blender to opengl JAVA Android(or just java) [on hold]

ehhhh hello guys Im tried load UV texture which i made in blender. In blender it's ok Figure loading ok, materials loading ok. But problem with texture.. i dont know whats wrong cos im new in ...
0
votes
0answers
11 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 ...
-1
votes
0answers
27 views

Looking for a point to start (Tutorial or something) [on hold]

I want to make a 2d top-down RPG just like "Harry Potter and the Prisoner of Azkaban" on GBA. (Yeah, I know it's oldskool, but I love it!) Can you guys give me a point to start, like a tutorial or ...
0
votes
1answer
70 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
73 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 ...
0
votes
2answers
69 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
49 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
17 views

How to determine the pixel coordinate values of regions in an image? [on hold]

I am following a tutorial on how to make a flappy bird clone from http://www.kilobolt.com/day-6-adding-graphics---welcome-to-the-necropolis.html. I am on the part where the actual graphics of the ...
0
votes
0answers
12 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
61 views

Java game runs slower and slower as game runs longer [on hold]

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
15 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
0answers
26 views

Is there a way to implement agent simulation for a city builder in Java? [closed]

The agent simulation will be used in a city builder for things like traffic or people who will have jobs, homes and they will have to travel via computed routes. Is there a way to implement something ...
0
votes
1answer
33 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
12 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
102 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
30 views

Libgdx getting random position on screen is null?

So, I want to get the random position on my screen to spawn enemies on them. but here's problem. int randX = r.nextInt(screenWidth); int randY = r.nextInt(screenHeight); Apparently these are null, ...
0
votes
0answers
38 views

Simple Game State Manager [closed]

I'm in the process of making a simple BreakOut clone. At the minute the play mechanics aren't too important (collision detection etc). What I'm currently working on is the Game State Manager. I've ...
0
votes
0answers
52 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
68 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
10 views

JBullet: How to add heightmap to dynamic world [closed]

I implements JBullet into my code. Boxes, spheres work prefectly. But I don't have idea how to implement to my world heightmap(as static object). What type of shape I must use and how? My heightmap ...
0
votes
0answers
29 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. ...
0
votes
0answers
55 views

Reading a file with unknown encoding [migrated]

I use libGDX for developing a game for Android platform. In my game, I'll have to parse some file that contain some settings (skin customisation, user map reader). My current code works for, at ...
0
votes
1answer
131 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
19 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
53 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
83 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
22 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
0answers
26 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
41 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
82 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
197 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
40 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
34 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
41 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 ...
1
vote
1answer
71 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
27 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
60 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
52 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
28 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
47 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
104 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
55 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 ...