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

0
votes
0answers
7 views

Transparent JPanel, Canvas background in JFrame

I wanna make canvas background and add some elements on top of it. For this goal I made JPanel as transparent container with setOpaque(false) and added it as first of JFrame container, then I added ...
0
votes
1answer
22 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
73 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
25 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?
0
votes
0answers
28 views

Map rendering Libgdx Java

Ok, so I am trying to create a 2D non-movable random tiled map. This is what I have so far: private void generateTile(){ System.out.print("tiletry1"); while(loadedTiles != 8100){ ...
1
vote
2answers
100 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
0answers
23 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 ...
0
votes
0answers
19 views

Java, two JPanel on JFrame - Settings JPanel, StartMenu JPanel [on hold]

There is my first question and I welcome community! I'm making a simple game and have some problems with Start menu. I have three buttons on my JPanel StartMenu and when I click "Settings" button, ...
1
vote
2answers
131 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 ...
-1
votes
0answers
8 views

LIBGDX “parsing error emitter” with 2 or more emitters [on hold]

I have a problem with the use of particle effect of LIBGDX with 2 or more emitters. After using ParticleEditor to create my .p file, I use it in my code BUT...when I use only 1 emitter it's fine but ...
-2
votes
1answer
70 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): ...
-2
votes
0answers
16 views

Adding HighScore [on hold]

I want to add a HighScores to my High Score Screen. Now when I start playing the game the score starts and just goes up. Then when the game is over I wont the highest scores to go adding to the ...
-1
votes
0answers
30 views

Is drawing 3D graphics with AWT even worth it? [on hold]

I'm trying to build a rasterizer with AWT just for the heck of it. Depending on how I make it, it could be quite fast or quite slow. I don't want to use OpenGL or anything like that for the sake of ...
-1
votes
0answers
19 views

Libgdx MainMenu [on hold]

I am making a menu for a libgdx game. In my menu I have only one button. I have tried to code it but every time I lauch the game it just closes. Here is my MainMenu class: public class MenuScreen ...
-1
votes
0answers
17 views

How do i use sprites to give a point on my grid a texture

How would i give a point on my 2d grid a texture using sprites ? edit: For example i have an 2d array grid 11/11 and i would like to make an GUI where it just shows the grid for the moment how would ...
0
votes
0answers
14 views

Java GUI Transparent overlay, which has a menu in it, by clicking a button [closed]

Hello lovely community, I'm Leon and at developing a little jump n run.I'm sitting since rough 24 hours on the laptop to find a solution for my problem. So my GUI starts up with a little menu, in it ...
0
votes
1answer
31 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
34 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
72 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
27 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
52 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
81 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
92 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
167 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
29 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
25 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 ...
-1
votes
0answers
18 views

Help starting out on Eclipse ADT [closed]

I have experience with Java using regular eclipse and creating games on the hsa_ufa console which I did in a high school class. I want to try making a simple 2D game that I can run on my android ...
0
votes
1answer
83 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. ...
-1
votes
2answers
56 views

Switch statement for map change [closed]

I'm using the LibGdx libraries, and I'm trying to construct a switch statement to change levels. So far I have: public void changeMap(int map){ switch(map){ case 1: newMap = new ...
0
votes
1answer
47 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
150 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 ...
-2
votes
1answer
78 views

State Management [Replaying the Game, Switching States] [closed]

How to effectively switch states?Whenever I press the replay button, the two states shows alternatively (win & play). I believe that was an infinite loop but Eclipse does not print any errors. ...
0
votes
1answer
79 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. ...
-2
votes
2answers
98 views

Java basic game Collision [closed]

I have looked and looked and I still couldn't find any help :( I have searched and I know it has been asked a lot but I really need some help now I'm still new to java. So I'm trying to do some basic ...
-1
votes
0answers
25 views

Parallax runner game obstacles AndEngine

Hi I recently started making an AndEngine runner game so for that as you guessed I need AutoParallax background so the screen would be moving all the time. I know how to do that part but what I want ...
-1
votes
0answers
274 views

JMonkeyEngine: Error in collision detection between terrain and rays

I have the following code, this is a basic setup to allow terrain edditing by mouse later on: public void simpleInitApp() { flyCam.setMoveSpeed(50); terrain = new WorldTerrain(this); ...
-1
votes
4answers
83 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 ...
0
votes
1answer
28 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
28 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
30 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
64 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 ...
0
votes
1answer
58 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
47 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
38 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
14 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
38 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
20 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
248 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
36 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 ...