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
1answer
103 views

Dynamic object creation with HashMap

I want to use a HashMap to dynamically create objects based on the key. I have a Random Map Generator that stores the maps in 3D Arrays of Type Integer[][][]. Upon creation of the actual map I ...
1
vote
1answer
125 views

Pokemon Yellow wrap transitions

So I've been trying to make a pretty accurate clone of the good old Pokemon Yellow for quite some time now and one puzzling but nonetheless subtle mechanic has puzzled me. As you can see in the ...
-3
votes
1answer
40 views

How can I perfectly center an image in a window using Slick2d?

Dividing the window's width by two to position it in the middle of the x-axis did not work. What else can I do?
1
vote
2answers
142 views

Why does my code dividing a 2D array into chunks fail?

I have a 2D-Array representing my world. I want to divide this huge thing into smaller chunks to make collision detection easier. I have a Chunk class that consists only of another 2D Array with a ...
0
votes
1answer
81 views

How could I implement 3D player collision with rotation in LWJGL?

I have a problem with my current collision implementation. Currently for player collision, I just use an AABB where I check if another AABB is in the way of the player, as shown in this code. (The ...
1
vote
3answers
196 views

What datastructure would you use for a collision-detection in a tilemap?

Currently I save those blocks in my map that could be colliding with the player in a HashMap (Vector2, Block). So the Vector2 represents the coordinates of the blog. Whenever the player moves I then ...
-2
votes
1answer
92 views

Calculate velocity of a bullet ricocheting on a circle

I made a picture to demostrate what I need,basecaly I have a bullet with velocity and I want it to bounce with the correct angle after it hits a circle Solved(look the accepted answer for explain): ...
0
votes
1answer
61 views

TileEntitySpecialRenderer only renders from certain angle

I'm developing a Minecraft mod with Forge. I've added a tileentity and a custom renderer for it. The problem is: The block is only visible from sertain angles. I've compaed my code to other peoples ...
-1
votes
1answer
70 views

LibGDX Json not parsing full file

I'm trying to load a World with different Objects (World Objects and Entities). For that, I want to use Json. For less than two elements this works like a charm. But as I add more elements, some ...
1
vote
1answer
98 views

making a monster encounter method

I'm currently making my own little 2d text based game and I've got a 11 / 11 grid where a monster spawns in the middle and when i stand on it's position and it brings me to another 11/11 grid where i ...
0
votes
0answers
50 views

LibGDX - How to move Actor with fingers Code?

I am completely new to Game Development. I See all these Questions and Answers and Codes and I have no clue what to do with them. I need some Guidance. My Plan: I want my Actor to move up and down, ...
0
votes
1answer
86 views

NiftyGUI - Text isn't rendering

I am trying to create a gui with nifty on top of lwjgl. I've already had some problems during the Nifty setup, however now Nifty is set up and running correctly but for text rendering. Here is my xml ...
0
votes
4answers
115 views

Accurate sprite rotation with mouse movement

I am using the current mouse position to aim the player sprite, but I am not getting the best results. It will often by off by a noticeable amount, or even a complete ~180 off if I go from one side, ...
3
votes
1answer
113 views

How do I get the number of online players in a Minecraft server from outside the client?

I know that the Minecraft client can query the server for number of players and maximum players, even when the server properties has enable-query set to false, but how do I do this outside of the ...
2
votes
4answers
192 views

Designing a scriptable questing system

I'm currently working on a scriptable questing system. As for scripting, I will probably use JavaScript, but I'd appreciate some help with the design of the system. My first attempt essentially ...
16
votes
3answers
3k views

Is there any harm in having the main game loop run uncontrolled?

I was wondering if there is any possible harm when my game loop runs as fast as the system allows? I currently have a loop, that, by measuring passed time in nanoseconds, runs the game logic and ...
0
votes
1answer
64 views

Swiching screen at collision LIBGDX

I am programming with LIBGDX and I am working with a piece of code. What I want to happen is that when the BUCKET collides with a DROP the game switches screens back to the menuScreen. I have tried ...
0
votes
1answer
65 views

Java2D Shooting in a line tangent to mouse coordinates

I am making a top down shooter in Java and I need to be able to shoot in a line tangent to the mouse coordinates. In other words I need to be able to click my mouse and have a projectile spawn from my ...
0
votes
1answer
86 views

Which input event is suitable for this game?

I am trying to clone this game: http://www.ferryhalim.com/orisinal/g3/bells.htm As i am using libgdx, so the game is both for Android and PC. I was wondering which input event would fit in nicely. ...
0
votes
1answer
87 views

Rendering tilemaps at a specific position libgdx

I'm making an endless side scroller game like gravity guy with libgdx. To test this I'm just creating two tiled maps with the same .tmx file to render then one after another, like: ...
0
votes
1answer
228 views

How do I decompile Minecraft?

I'm trying to get started modding Minecraft. I opened up the minecraft.jar file in Eclipse, but it doesn't contain what I expected. In this tutorial the presenter decompiles minecraft.jar and finds ...
0
votes
1answer
105 views

Making Player Jump

I have been editing a piece of code and I have already implemented gravity so I would like to know how i could make the player jump when the screen is touched. I would like the player bucket to jump. ...
-1
votes
3answers
96 views

Shooting based off mouse position [duplicate]

I'm trying to shoot bullets where the mouse is aiming using one image as a test. I'm trying to get the mechanics like this I have some kind of algorithm to handle that but the results arn't too ...
1
vote
1answer
63 views

How do I draw a line using jme3.scene.shape.Line in JMonkeyEngine 3.0?

I can successfully create the object, but it can't be attached to the rootNode. What can I do to make the line appear? I'll also would like to know how to reverse the effect(making it disappear) ...
0
votes
1answer
49 views

LibGDX ShapeRenderer rotated

I'm having a weird problem with the LibGDX ShapeRenderer where it draws everything rotated. Here are some images to show you what i mean: This is what it looks like in Tiled(Map Editor): This is ...
0
votes
1answer
64 views

Setting bounds to a label in libgdx

textStyle = new LabelStyle(); textStyle.font = font; textStyle.fontColor=Color.GREEN; EnterTextCasheir= new Label("",textStyle); EnterTextCasheir.setBounds(AssetsHelper.convertWidth(158), ...
0
votes
0answers
123 views

Proper way to load pixel art textures for 2D graphics

I am working on developing a game using LWJGL which is the java bindings for OpenGl. I have just finished the code for loading and animating sprite sheets using a png and xml file. When the texture ...
1
vote
2answers
113 views

2D Lighting Glitch

I've been working on a game in Java, and recently I decided to try out my game on a netbook just to see how it would run. While I do get a constant and decent FPS, it appears that my lighting ...
0
votes
1answer
65 views

How does super.render() call this method?

Today I was experimenting with adding different screens with Scene2d in libgdx and while doing so I became confused how super.render() in my render() method from my starter class (MyGdxGame) called ...
0
votes
1answer
62 views

Loading non-square textures, from a 256x256 spritesheet in lwjgl(JAVA)

so I'm doing lwjgl, so far I have the loading of 16x16 textures from a 256x256 spritesheet all working, using this code to get the location of the textures: public Vector2f[] calculateUVMapping(int ...
0
votes
0answers
34 views

[LibGdx]Moving a fixture on a body

I'm working with Box2D and I have a basic platform and a box bounces off of it. // Static Platform bdef.position.set(160 / PPM, 120 / PPM); bdef.type = BodyType.StaticBody; Body b = ...
0
votes
0answers
131 views

Gdx.graphics.getDeltaTime(); Returns 0

I am coding a game in Java using Eclipse and Libgdx. I am trying to make an object move until it reaches a certain random point. I am relying on delta time to make the objects speed the same on ...
0
votes
1answer
34 views

LibGDX - Accelerometer Problems

I got some issues. I'm using LibGDX. When I hit an object, my Fighter is supposed to fall to the Ground. BUT, because of the Accelerometer, i can still move it up and down eventhough it died. The ...
0
votes
2answers
269 views

terrain not properly rendering

I'm extending the terrain quad with resources from various tutorials and have the following code: public class WorldTerrain extends TerrainQuad { public static final String NAME = "terrain"; ...
0
votes
0answers
76 views

Ray-Triangle Intersection Detection using Barycentric Coordinates

I am attempting to convert the algorithm from http://www.cbloom.com/3d/techdocs/fast_ray_tri.txt to java code, but my solution does not function correctly. The only intentional change I made was for ...
2
votes
2answers
130 views

Implementing Mouse Lasso

I am toying around with a Boogaloopers clone (http://www.youtube.com/watch?v=zuaRi_fhdlQ). I have a small problem with the lassoing. Here's my current naive algorithm. The problem with this is that ...
0
votes
1answer
107 views

GPL Game Engine - What needs to be released under GPL?

I'm hoping I can clarify this issue. Note, a similar question has been asked here, but it doesn't really give a specific enough answer that I can comprehend at this point! :- How does one escape the ...
0
votes
0answers
47 views

Libgdx project “Not Responding” when in debug mode

So the problem I am encountering is that whenever I attempt to debug my Libgdx desktop project and Android project the "app" is constantly "frozen" or "Non responding." By this I mean that I cannot ...
0
votes
2answers
91 views

Switching a project written in Lua to a compiled language [closed]

I am experimenting with game development in Lua using the Love2D framework, and while it works fine, I am getting tired of using a dynamic scripting language. I would like to have better performance, ...
1
vote
1answer
81 views

Box2DLights - the center of sprites are always 100% unlit (black) unless Xray is on

I'm using a ConeLight at 180 degrees, with this setup: pl = new ConeLight(rayHandler, 256, new Color(0.5f, 0.5f, 0.5f, 1f), 280f, 400 - x, 300 - y, 0, 180); And the object I'm casting a shadow on ...
0
votes
2answers
77 views

LibGDX how to change animations

I have a Player Class and i have 3 different Animations for it. I can render them perfectly but i don't know how to change from one animation to another. For exmaple i have 3 animations, one for ...
1
vote
1answer
100 views

Design pattern for animation sequence in LibGDX

What design pattern to use for sequence of animation that involve different actor in libGDX. For example I am making a game to choose a wolf from a group of sheeps. The first animation played when the ...
0
votes
0answers
69 views

JBullet quaternion to Euler angle conversion causes strange flipping behavior

I am making a game using JBullet (a Java port of C++'s Bullet library) for the physics and LWJGL for the graphics. However, JBullet measures angles in quaternions and LWJGL uses Euler or ...
0
votes
1answer
53 views

How can I make an soundsystem with slick?

My Question would be , how can I develop an easy-to-use Soundsystem under slick-util? Under the function a.playAsSoundEffect(1, 1, true, x, y, z); it allready works to create a static ...
1
vote
1answer
203 views

If I convert my LibGDX game to an exe, is it legal?

I have a LibGDX jar file, and I want to have it as an EXE. Would that be legal? (Using launch4j) Also, how do I obfuscate a LibGDX game?
1
vote
2answers
246 views

Is it possible to create 3d games with good performance in java? [closed]

Recently i use Javafx 8 for creating small 2D games , but i think it can't manage memory and other things very well .I see Jmonkey jmonkeyengine as a game engine for Java and i see some videos of ...
0
votes
1answer
183 views

Fixing game loop to 60fps makes animation very jittery

ns is 1000000000 / amountOfTicks; long now = System.nanoTime(); delta += (now - lastTime) / ns; lastTime = now; if (delta >= 1) { tick(glad); updates++; ...
0
votes
1answer
70 views

LibGDX - Textures rendering at wrong position

Update 2: Let me further explain my problem since I think that i didn't make it clear enough: The Y-coordinates on the bottom of my screen should be 0. Instead it is the height of my screen. That ...
0
votes
1answer
160 views

The sprite will not move in libGDX

When I ran the android application, The sprite image will not move when I press the input keys. I followed a tutorial based on input keys and wish to know what's wrong. Can anyone see what's wrong? ...
-1
votes
1answer
130 views

How do I find the tile I'm standing on?

I want to get the specific tile I am standing on. My Tiles are in an Arraylist so I can destroy them later. How can I do this? Here's my Level-class (where my Lists are): public class Level { ...