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

-1
votes
0answers
21 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
10 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
26 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
36 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
66 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
58 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
42 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
15 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
56 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
14 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
25 views

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

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
32 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
11 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
93 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
27 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
49 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
64 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
9 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
129 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
52 views

Generating proper heightmaps? [closed]

So right now I am using greyscale heightmaps to load the height of the terrain to my game. So far I cannot seem to create a heightmap in which I can actually control where land masses are etc. I just ...
0
votes
0answers
82 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
20 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
25 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
81 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
192 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
33 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
59 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
46 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
103 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
54 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 ...
-1
votes
0answers
36 views

libGDX sprite disappears after 5seconds

I`m learning java for some time and decided that I want to make a game using libGDX. Everything goes well except gravity and jumping. Im not using Box2D so i found tutorial where jumping was solved ...
0
votes
1answer
143 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
44 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
53 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
54 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
32 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 ...