Tagged Questions

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

Box2D random crash when adding joints

I'm currently working on a project which uses Box2D, when the player uses a certain key it should anchor to the ground. For that I use a weld joint, but when I add the joint the game will sometimes ...
0
votes
3answers
402 views

how to design transparent screen in libgdx

this question is for LibGdx geeks. I want to make transparent screen in my game. For example, when level completes I want a new transparent screen pop up and show player's high score, buttons to ...
-1
votes
1answer
90 views

What is “immediate mode” in LWJGL?

I am not sure what "immediate mode" is in the context of LWJGL. I think it's when you use gluPerspective() function?
1
vote
1answer
186 views

Sphere-Sphere intersection and Circle-Sphere intersection

I have code for circle-circle intersection. But I need to expand it to 3-D. How do I calculate: Radius and center of the intersection circle of two spheres Points of the intersection of a sphere ...
-1
votes
1answer
74 views

Get stick analogue XY position using Jinput in lwjgl

I want to capture the movement of the analogue stick of the gamePad. is there any equivalent function to this? public void mouseMoved(MouseEvent mouseEvent) { mouseEvent.getX(); //return the X ...
-1
votes
1answer
81 views

How do I put different textures on different walls? LWJGL

So far I have it so you are running around in a box, but all of the walls are the same texture! I've loaded up other textures for the walls (I want the walls a different texture than the floor) but it ...
1
vote
1answer
123 views

Java Slick2d Animation not working

Hello everyone I am trying to make a simple 2d game using java and the slick2d library. this is my first time doing it and i need some help. Right now I am trying to make the Animations for the ...
0
votes
1answer
87 views

Slick and Timers?

I'm making a game where I need events to happen in a precise amount of time. Explanation : I want that event A happens at 12000ms, and event B happens every 10000ms. So "if"s should looks like this. ...
7
votes
2answers
555 views

Java single Array best choice for accessing pixels for manipulation?

I am just watching this tutorial https://www.youtube.com/watch?v=HwUnMy_pR6A and the guy (who seems to be pretty competent) is using a single array to store and access the pixels of his to-be-rendered ...
0
votes
1answer
56 views

Problem with boundary collision

The problem: When the player hits the left boundary he stops (this is exactly what I want), when he hits the right boundary. He continues until his rectangle's left boundary meets with the right ...
1
vote
1answer
589 views

LibGDX: Smooth movement on a grid based game

I'm making a game with LibGDX where the player is on a grid (like a Chess board). For now, I'm moving the player by teleporting him 16px in a direction. I'd like to use the delta time to make smooth ...
4
votes
3answers
434 views

How to rotate a set of points on z = 0 plane in 3-D, preserving pairwise distances?

I have a set of points double n[] on the plane z = 0. And I have another set of points double[] m on the plane ax + by + cz + d = 0. Length of n is equal to length of m. Also, euclidean distance ...
0
votes
3answers
77 views

If player leaves a rectangle take him back to his previous position

Okay, I'm making a game. The map contains all the blocks/buildings/structures etc... The map is bordered by a rectangle. So what I want is if the player attempts to exit the rectangle he goes back to ...
0
votes
1answer
655 views

LibGdx efficient data saving/loading?

Currently, my LibGDX game consists of a 512 x 512 map of Tiles and entities such as players and monsters. I am wondering how to efficiently save and load the data of my levels. At the moment I am ...
0
votes
0answers
170 views

SurfaceView.Callback.surfaceDestroyed is called too early in Android

I'm making a simple animation application. Everything works as planned, except one little detail: About 50% of the time, exiting the application (Home or Lock button), makes the Logic throw a ...
1
vote
3answers
347 views

Interpolation using a sprite's previous frame and current frame

Overview I'm currently using a method which has been pointed out to me is extrapolation rather than interolation. As a result, I'm also now looking into the possibility of using another method which ...
0
votes
2answers
114 views

What design pattern should I employ for validating character movement?

I'm developing a RPG in Java and have a Map class, which will contain all the MapObjects (the Player, Enemies, Walls, etc.): Map.java public class Map { private int width; private int height; ...
2
votes
1answer
140 views

AndEngine GLES 2 Animate Character [closed]

I want to animate my character in game. My graphic animator prepare for me three options. Frame-by-frame by this is over 9MB for one animation. With TextureSpriter 4-5MB. Spriter but I can't find ...
1
vote
2answers
261 views

Cover Screen with Snowing Effect in Libgdx

Oddly enough I cant find clear instructions on this theme (I only found rain and the method is very particular) so I ask, how do I implement a whole-screen snow-falling effect? The methods i can ...
0
votes
1answer
81 views

TiledMap resizing and aspect ratio with LibGDX

I'm making a game and I don't know how to resize my TiledMap when the window is bigger but keeping its squared shape. Here is a screen: When I change window size, here's what happens: I want ...
0
votes
1answer
215 views

libGDX SpriteBatch reuse

Using libGDX, sprites or simply texture regions must be inserted into the batch for drawing: void render() { batch.begin(); batch.draw(...); batch.end(); } Is the VBO being uploaded ...
0
votes
1answer
59 views

Resizing the window moves and stretches the texture

I have a basic screen with 3 TextureRegions rendered on the screen rendered with this code(Ignore the hardcoded numbers, bad decision I know will be replaced later): Gdx.gl.glClearColor(0, 0, 0, 0); ...
0
votes
1answer
135 views

Should I use more than one panel in a java game ?

I' m creating a game in java, and it has this schema: I use the main class to launch my game and I create a frame to add a panel, that is defined into GamePanel class. public class MainFrame { ...
0
votes
0answers
56 views

Box2D and randomly generated tilemaps

I am making a 2D Terraria-style sidescrolling game. I want to use box2d for the physics. However, I am using tilemaps for the maps, and I do not know of a processor-efficient way to use Box2D bodies ...
0
votes
1answer
95 views

Collision intermittently fails when multiple bullets on screen

I'm building a very simple Java game where a player rectangle fires bullet rectangles at enemy rectangles. When a single bullet is on screen, it always correctly collides with enemies. When multiple ...
0
votes
2answers
252 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
1answer
78 views

How to make a sidescrolling effect in lwjgl

I use the following methods and the screen moves away from the player. glTranslatef(h.x - width/2, h.y - hieght/2, 0); if ((Keyboard.isKeyDown(Keyboard.KEY_D))) { h.x += 10; ...
0
votes
1answer
41 views

How to handle runtime exceptions that occur on a loading process delegated to newly spawned thread

I am looking to multi-thread the resource allocation routines (i.e world loading) in my game so that they can occur in the background whilst rendering a loading screen etc... The problem is, I used to ...
-1
votes
1answer
70 views

How to load resources in LWJGL [duplicate]

I've been searching for days. When I export and create my fat jar it loads and disappears. It can't find my images. This is what it all looks like. I used something like this to load them: File a; ...
1
vote
2answers
145 views

libgdx: How do you remove a cell from TiledMap?

I am making a Terraria-style sidescrolling game with an open world. I am using a TiledMap to render all of the tiles. If I want to remove a tile, like if it is broken, how would I stop it from being ...
0
votes
1answer
88 views

How can I center an arbitrary string over a sprite?

Eyesore: The problem is, the text should be exactly centered over the player, I want something like this: My code to draw username above the player is: g.drawString(username,(int) playerX,(int) ...
4
votes
1answer
95 views

Why is my Slick2D spritesheet animation cut off when it loops?

I am loading a SpriteSheet with Slick2D and using the Animation function in the render method to display it. The spritesheet loads perfectly, but when the animation loops, it does so moved down a few ...
0
votes
1answer
84 views

(LWJGL) Exporting Textures with JarSplice [duplicate]

I have another game that uses rectangles instead of textures and works just fine. when I run this I get this error: Microsoft Windows [Version 6.1.7601] Copyright (c) 2009 Microsoft Corporation. ...
1
vote
2answers
109 views

How do I scale a rectangle image while retaining its border thickness?

I want to create a programmatically scalable image like this: scales to . Both have a one pixel border. If I scaled from the first to the second in Paint.NET, there would be a two pixel horizontal ...
5
votes
4answers
1k views

Does Unity let you code in Java?

I am fairly new to Unity3D experience , but I have a very good knowledge of Java and Android development. I am really confused that if Java is at all needed for developing android applications? I read ...
2
votes
1answer
175 views

In Slick2D, how can I generate a 2D platformer map from an image?

I'm fairly new to game development. I've been messing around with Slick2D. My map consists of rectangular objects. I want to use an image to represent my map, similar to this: How could I generate ...
0
votes
0answers
59 views

How to create a 2D overlay over a 3D game? (LWJGL/OpenGL) [duplicate]

GameDev! I would like to create a 2D overlay over a 3D world, using LWJGL (Java version of OpenGL), to show information to the player, for example, a chat box, health bar, selected cannonball type, ...
1
vote
1answer
146 views

Bullets won't shoot out of barrel in top-down shooter

So I am working on a top down shoot and have been stumped on why my bullets refuse to come out of the barrel of the gun. I know about the rotation equation which is x2 = x * cos(theta) - y * ...
7
votes
2answers
781 views

How can I make a snake's tail follow the head?

Following an assignment and just getting started with libGDX by building a small Snake clone I've run into an issue that I'll probably be ashamed for in a little while. I currently have a snake's ...
-1
votes
2answers
112 views

How to implement “move to touch location” function?

What is the formula/logic to implement moving an object towards a TOUCHED location. I want character A to move to my finger and it must be accurate. Here is what I have tried so far: @Override ...
1
vote
2answers
324 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
154 views

Driver inversion

I have a GUI game, which is driven by user every time it clicks the mouse. Every time user clicks a square on a board, the board state is updated (we re-compute the score, the player to make next move ...
1
vote
1answer
262 views

What alternatives are there for creating Keyboard/Mouse controls in LWJGL?

So I'm currently working my way through openGL tutorials, using LWJGL to do all my work in. However as I get to the part on how to access Keyboard and Mouse events in this library, I stumble across ...
0
votes
0answers
218 views

Adding 2d hud/gui to a 3d game engine which has no 2d features

I have been following the 3d game engine tutorial series made by theBennyBox for a few months now, and have finally decided to create a game with it. My problem is that it is a 3d only engine which ...
1
vote
1answer
113 views

Structure gameobjects and call events

I'm working on a 2D tile based game in which the player interacts with other game objects (chests, AI, Doors, Houses etc...). The entire map will be stored in a file which I can read. When loading the ...
0
votes
0answers
66 views

Cube projection composed of smaller cubes not lining up

I am trying to make a cube projection composed of other cubes, similar to a Rubik's cube but completely static. I can get one cube to work, but when I join multiple, they don't line up. I am using ...
0
votes
1answer
78 views

Minecraft Modding Errors (.java to .class compression errors) [closed]

Recently I started making a personal modpack. I ran into a block ID conflict and decided to fix it. I figured out how, and managed to change a .class file to .java so I was able to edit it. Now comes ...
0
votes
1answer
179 views

Parse and iterate over SVG path

I need to parse a SVG path expression like m8,295c-4,-292 441,-291 446,-26c5,265 440,263 442,-9 and have a way of iterating over it in [0 ... 1]. I looked into Apache Batik but it doesn't seem to ...
2
votes
1answer
137 views

RGBA values not coming as intended | LibGDX

As it states, my RGBA values aren't coming out the way I want it to be. My RBGBA values are As it states, I am trying to create a orange tinted color on my game. 221, 189, 98, 0.7 I am using a ...
1
vote
1answer
118 views

[ C# ]xna to monogame

I'm thinking of going back to xna and c# because I have used java 2d, slick 2d and some other libraries. I started off with xna and c# but ignored it for java. I'm thinking of going back, but I see ...