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
vote
1answer
17 views

libgdx, how to check collision of randomly generated actors?

I have two groups of randomly generated actors, one is bullets second is enemies. And as of now I have no idea how to check collision of randomly genrated actors and remove the overlaped actors. I'm ...
0
votes
0answers
15 views

Can't import org.lwjgl.opengl.Display [on hold]

I have problem , i want to start learn lwjgl i copy the source code here http://thecodinguniverse.com/lwjgl-window/ while i import import org.lwjgl.opengl.Display; import ...
0
votes
0answers
46 views

Game loop that works on every smartphone [on hold]

So i am developing a game in Eclipse (Android SDK) and having troubles with perfect game loop. I tried couple of tutorials but with no success. I was wondering is it possible to have perfect game loop ...
0
votes
0answers
22 views

Box2d for large game? [on hold]

I am considering developing a terraria clone for testing purposes and also as a challenge. The physics engine has always been tough for me to smooth out so I am considering using Box2d. My concern is ...
1
vote
0answers
27 views

How do I fill a shape with a texture in Libgdx?

I am making a 2D racing game. I want to fill the area of the ground object with a texture. I have the shapes of the ground (a Box2D shape). If I make images of the ground with textures, it uses a lot ...
0
votes
0answers
20 views

Java code migration to Android [on hold]

I have a working code, which can generate and draw some figures with lines. It has written in native Java. I would like to migrate this code to Android and give some fancy graphical desgin, beacuse it ...
1
vote
2answers
91 views

How can I load a level using a sound file? [JAVA]

I'm trying to load a level from a music file (mp3, midi, etc, I'm not picky) for a rhythm-based game. I must be searching in all the wrong places because I can't seem to find any help on this topic. ...
0
votes
0answers
33 views

How can I share high scores on Facebook from a desktop libgdx game?

The Android version of my game can share scores on Facebook. How can I do this on the desktop version? Is Gdx.net.openURI (“http://graph.facebook.com/me/feed”); sufficient?
0
votes
1answer
27 views

Collision detection Libgdx

I'm trying to implement Collision detection using Rectangles for my game but can't seem to get it to work. Bullets are updated when pressing space every frame so they move across the screen. ...
0
votes
0answers
9 views

Libgdx Scene2d shows White screen when executed

package com.Darth377Apps.DeepShadow; import com.badlogic.gdx.*; import com.badlogic.gdx.graphics.g2d.*; import com.badlogic.gdx.scenes.scene2d.*; import com.badlogic.gdx.scenes.scene2d.ui.*; import ...
0
votes
0answers
8 views

Libgdx: ModelInstance texture is not rendered on Java8

I have project based on opengl, libgdx framework. It's impossible I think, but when I switch my project from Jdk1.7 on Jdk1.8 I have problem with rendering model's texture. I have no idea how language ...
0
votes
0answers
40 views

Generating Mesh From Voxel Data [closed]

I need help converting a 3D array of voxels (The array indexes are the voxel positions) to an actual voxel terrain mesh (float array for vertices, And a int array for indices) So i can render a chunk ...
0
votes
1answer
34 views

Box2D pixel to meter conversion

I have a game that was written in pixels and now I want to change it to meters like(box2D do). How I need to do that. I have wached a lot of tutorials and all they have some SCALING FACTOR but when I ...
0
votes
1answer
53 views

Player being covered by glClearColor?

Here is a video of the problem: https://www.youtube.com/watch?v=6vnDOB1Vk4o (this is the game I've been making for fun/practice). You notice, in the beginning of the video, I walk off the map and ...
0
votes
1answer
35 views

Ray casting problem using JOGL

I'm trying to port an old perfectly functioning ray casting implementation from my lwjgl project (FF pipeline) to a new project using JOGL and shaders. My problem is that my ray no longer intersects ...
0
votes
1answer
46 views

Tile map only rendering 1 layer when it should be 3

I've been working on this for a while and I can not seem to figure it out. I had the fileParser() method in the constructor and it worked fine. Then I was told it's very bad practice to have it in the ...
0
votes
1answer
14 views

Predicting circle-circle bounce vector when aiming one at another

I am making a game with libGDX (with box2d) in which you drag and aim one circle body at another then release to fire. I would like to be able to predict the path of the second circle based on the aim ...
0
votes
1answer
13 views

Andengine onAreaTouched TouchEvent not working - ACTION_OUTSIDE & ACTION_CANCEL

I have a simple problem. I have a button on the screen. I want isActionDown to push the button down, and isActionUp to push the button back up again and make my character jump. But the problem is if I ...
0
votes
0answers
6 views

Problem with the method unproject of the class OrthographicCamera of LibGdx [closed]

cam is a object of OrthographicCamera v3 is a object of Vector 3 in the next line the play closes in android, in the PC it works good, I don´t which is the problem cam.unproject(v3); Thanks very ...
0
votes
0answers
15 views

Leaderboard in game, android, LibGDX [closed]

I am developing android game using LibGDX engine (java) , I want to put leaderboard (top scores) in it . I can't find any tutorial that explains how to do it using Google play services , any ...
1
vote
0answers
37 views

How to turn off antialiasing in Graphics class?

I have been using the following code with a Graphics2D buffered image g.setRenderingHint(RenderingHints.KEY_INTERPOLATION,RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR); to ensure the image ...
0
votes
0answers
88 views

Best way to develop a Web based RPG game - after some research [closed]

I've been researching this for a while, and I'm in need of some pointers(:D) the thing is this - I have 3 options in mind: HTML5 + Javascript Java applets(is that still a thing?) unity web player ...
0
votes
1answer
27 views

LibGDX Bounding Rectangles

I'm creating some rectangles surrounding my sprites for my player and bullet class to detect collisions with the overlaps method in Intersector class of LibGDX. I have a question: When I instantiate ...
0
votes
0answers
37 views

Make a smooth curved terrain from chain shape [closed]

what have i tried: Vector2[] vs = new Vector2[6]; vs[0] = (new Vector2(-50, 7.3f)); vs[1] = (new Vector2(-18, 7.3f)); vs[2] = (new Vector2(-10, 2)); vs[3] = (new Vector2(-5, 4)); vs[4] = (new ...
4
votes
4answers
234 views

How to avoid duplication using client-server model

I am using a client-server model to write a multiplayer-capable game (in Java). Currently the clients and the server are using the same code to run the game logic, in order to enable client-side ...
0
votes
1answer
23 views

box2d ChainShape into curved line

i need to draw a curved line , i searched the internet and found nothing , maybe someone with knowlegde on the subject can help me with a link , i used chain shape and did this , and i don't know ...
0
votes
0answers
29 views

Problem with changing font color in libgdx

I recently noticed that my version of libgdx was way out of date, so I updated from version .9.something to 1.4.1. I copied files for the project I'm working on over into a new project generated with ...
0
votes
2answers
63 views

Game Background graphics blurred edges?

Why when using this code for the background for my game do I receive blocks with blurred edges? public final class State_Play extends State_Template { private BufferedImage background; ...
0
votes
0answers
20 views

Change a vertices and display corner of a polygon

I'm currently building a level editor for my game and i'm having some trouble on how to change vertices of a polygon. Basicly i searched the web trying to figure out how to update the vertices of a ...
0
votes
0answers
14 views

Cant Set Image Origin in Table Cell - LibGDX

I am having real issues with my Actors when placed in table cells. I would like to set center Origin to allow me to tween the scale around the center. I am aware that the Table is responsible for ...
1
vote
1answer
78 views

How can I implement a camera like the one in RotMG?

RotMG, an MMO top-down shooter, takes on a unique 2d-3d style, and has an intriguing camera; The game is obviously 3d, not simply isometric, and if you play the game and turn on camera rotation you ...
0
votes
0answers
26 views

Dynamic VBO update possibly corrupting data?

I want to draw a line between two vertices. On a mouseclick the vertex data will change and I want to update the line to use the new values. I am using a VBO for this and it looks like the update ...
0
votes
0answers
12 views

Removing extra blank window when adding Jmonkey based sound to Java based game

I'm currently programming a simple run and jump game in java. I'm in the process of implementing sound and I'd like to use Jmonkey's sound because I'd like to eventually switch the whole game over to ...
0
votes
0answers
24 views

glBlendFunc() makes primitively drawn quads disappear

i have experienced some issues with glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);. Having this invocation in OpenGL init code makes stuff drawn with the following methods ...
0
votes
0answers
11 views

Configuring eclipse exporting - export res folder into jar's /res [migrated]

NOTE: I use new File(...) instead of getResourceAsStream(...) so i can then easily make it to Slick's Texture class. I'm having a trouble with exporting my resources folder in eclipse. This is my ...
0
votes
1answer
47 views

Ram usage , libGDX game development

I am developing android game using LibGDX . The game data (images , sounds etc.) are maximum 25mb . But when the game is running on Android device it places 110mb there (look at the image) 110mb is ...
0
votes
0answers
14 views

Jmonkey Translucent Render Bucket fails to model object last

So I have a weapon model that moves wherever the camera moves and the rotation of the weapon is the same as the rotation of the camera. Additionally I added the weapon to the Translucency Queue Bucket ...
6
votes
1answer
2k views

Why do my images take 200 MB of RAM when they are ~20KB on disk?

I am creating an Android game using libGDX. When I load my nine images it takes 200 MB of RAM. But the images are 10 to 17 KB each. Why the discrepancy? Here is where I create textures from those ...
0
votes
1answer
12 views

Understanding HingeConstraint in jBullet

I'm using the java port of BulletPhysics engine jBullet. I'd like to make a joints between 2 triangles so that one edge of the first and one edge of the seconds act like a hinge. But I don't ...
0
votes
0answers
15 views

Using debugdraw in jbox2d

I've created a class which implements org.jbox2d.callbacks.DebugDraw. And implemented the abstract methods too. DebugDrawHandler extends org.jbox2d.callbacks.DebugDraw I've instanciated it with: ...
0
votes
1answer
48 views

Box2D Body creation causing performance issues

I have at max 10 dynamic bodies in my world at any time. they are created at random and fired up from below they screen. when a new body is being created, the fps falls from 59 - 61 to about 35- 40 ...
0
votes
1answer
184 views

OpenGL generate hills looking vertices

I want to generate a terrain which looks like hills. Some sort of sine waves. Should be as simple as possible. But I can not figure out how. I get very scary results, which are nothing worth. I need ...
0
votes
0answers
31 views

How to get yaw of bullet physics vehicle?

I am using the Bullet Physics port to java, JBullet, and am trying to render a vehicle body that i created in Blender on top of the vehicle chassis. Since i cannot effectively find a way to render ...
0
votes
0answers
39 views

OpenGL ES 2.0 - Applying rotation to only specific quads within a batch

This problem seems fairly simple on the face of it: How, when drawing a batch of quads using a triangle strip, can I apply a rotation to only one or some of the quads. I've been looking at this ...
1
vote
1answer
93 views

Making sprite rotate smoothly

I have a sprite that I want to rotate smoothly and face the opposite direction: This is my render function: public void render() { // Game Loop Gdx.gl.glClearColor(0.7f, 0.7f, 0.2f, 1); ...
0
votes
1answer
31 views

Making sprites move in oppsite direction of vector

I have a sprite that moves from the bottom left of the screen to the top right. What I want to know is how would i make it turn around and go in the opposite direction, and continue this loop. I ...
0
votes
3answers
99 views

Dynamic Crafting Systems [closed]

I have been toying with the idea of having a game that is based purely around crafting. That on its own is not much of a big deal. The way the crafting would work is the problem. The idea I have is ...
0
votes
2answers
102 views

Dealing with multiple scenes /levels

Overview I have a scene manager in my game and in each 'Scene' I have a render() and a update() method for drawing and updating my game's logic. Basically, when I want to switch to another scene, ...
0
votes
1answer
85 views

How to implement mouse based movement in an RPG? (Java) [duplicate]

I'm making a 2D rpg and I want the character to move with the mouse, ie the user clicks and then the character moves to that location. How do I accomplish this?
1
vote
2answers
145 views

Should FPS exceed ticks/second?

I was once told that you should never re-draw a frame if the game logic has not changed since the last draw. Assuming game logic is updated once every tick, and assuming a game runs at 40 FPS @ 20 ...