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

2
votes
2answers
2k views

Menus for LWJGL - Swing or other? [on hold]

Okay so I want to create a main menu which includes several buttons and text fields, is there a built in library for LWJGL or would I use normal Swing and start a thread of the application? Its a 2D ...
-3
votes
1answer
52 views

What's wrong with my step-toward-target implementation?

I want to move a game object from its current position toward the mouse position. I wrote this Vector2D class to help me: public class Vector2D { private double xVect; private ...
0
votes
2answers
46 views

How would I start my multiplayer game? (JAVA) [on hold]

I'm Bryce. I'm trying to create an online game. To give you an idea on what scale I am imagining this game to be at, I'm basically recreating Notch's cancelled game, 0x10c. I'm here to ask: where ...
0
votes
0answers
23 views

Collision detection bug in java applet

In my maze game applet I'm having a little bug. Collision detection works but sometimes my character can go into walls. More precisely it detects collision and moves the character into the wall. It ...
-1
votes
0answers
14 views

TextureAtlas issue get texture

I have a texture atlas and I want to get a specific texture in it by name, but I get all textureAtlas with all texture. Why? This is the code: this.textureLeft= ...
0
votes
1answer
56 views

Tiledmap rendering [on hold]

I want to hide and make visible the tile map based on a condition, the tiledmap top is visible then I want to hide and then make it visible again I've implemented in the following way: //map object ...
1
vote
1answer
158 views

Random lines away from images in java2d opengl game

Working on a java game that uses some pngs images for icons/textures. A few images ( fewer than 5, out of dozens ) are showing some odd parallel "artifact" lines. They move with the image, are ...
1
vote
2answers
104 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 ...
-4
votes
0answers
42 views

Please recommend any API to write bot on WIndows [on hold]

What API exist to write bots for internet games like Diablo III on windows box. Where all data exist on remote server. Ideally if api is written in java. But C# is also OK.
1
vote
3answers
87 views

How to handle network game [on hold]

I'm currently building my own game using LIBGdx in JAVA but i'm facing some trouble. My game is base like this : A player have a position and some other parameters that are float, int types. He also ...
-1
votes
0answers
16 views

getting sprite coordinates of mouse position java slick2D tiled map [on hold]

How to get sprite coords of mouse position? Game engine Slick2d. Tiled map 16x16. Camera public class Camera { public int x, y; Object object; public Camera(int x, int y) { this.x = x; ...
2
votes
0answers
40 views

Edit spawn location according to vector direction

I'm trying to make a turret in Bukkit (Java). This will shoot an arrow to the players that are in the shooting radius. But now I've a little problem, the arrow gets stuck inside the block where its ...
1
vote
1answer
81 views

Get the game state using Multithreading in Java Monkey Engine 3

I’ve been trying out Java Monkey’s multi threading recently via the wiki’s tutorial. Since I just wanted to test a prototype clinet, I made a program which creates some cubes using the ‘Cubes’ library ...
0
votes
3answers
97 views

Is there any way to load pieces of a tile-map as and when needed, and not the entire map at once?

I created a tile-based rpg game in java, but it runs really really slow, the reason is the big tile-map that is stored in the buffer. Is there any way to programmatically load pieces of the map when ...
0
votes
2answers
92 views

Recommended approach for event system in Java

What are the recommended approaches for an event system of a turn-based RPG's battle engine? The system I'm currently working on has a runEvent method that sorts the actions queue based on their ...
0
votes
1answer
70 views

Too much delay while sending object over UDP to server

I'm getting 4 sec delay when sending objects over UDP. Working on small game and trying to implement multiplayer. For now just trying to synchronize movements of 2 balls on the screen. ...
0
votes
1answer
25 views

Mouse coordinate conversion Libgdx

I have a camera: //Map is a my object that wrapper of TiledMap class In the create method: this.renderer=new OrthogonalTiledMapRenderer(this.map.getMap(); this.camera=new OrthographicCamera(); ...
-1
votes
4answers
155 views

How/where to generate RPG world?

I'm programming an RPG in java. It's text based, so movement is more or less from "room" to "room." In the case of cities, they will generally be one room, with some sub rooms for important shops and ...
0
votes
1answer
44 views

Collision bug with gravity in slick2D

I have fixed some of the previous problem. The collision when running into a corner(a wall on two sides) however is still not working. When the player runs into a corner he just falls down and out of ...
0
votes
1answer
26 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
1answer
50 views

Moving a tiled map in a jframe

I rendered a tiled map, with the help of slick2d, in my JFrame in Java. I can move my main character, but it is just that the character itself moves. I would like to do it that, if the player moves, ...
2
votes
3answers
845 views

How to draw a rectangle or curve between two co-ordinates in libGDX

I am new to libGDX.I just want a Rectangle or a small curve drawn between the object and the clicked position .I know libGDX has RECTANGLE class. I just want to draw a rectangle or a curved line to ...
0
votes
1answer
73 views

Slick2D: Animation not being parsed from spritesheet correctly

I have a 960x960 spritesheet with each tile being 192x192. I initialized my spritesheet and animation like so: spritesheet = new SpriteSheet("resources/spritesheets/player.png", 192, 192); ...
1
vote
1answer
121 views

Multiple enemy array in LibGDX

I am trying to make a multiple enemy array, where every 30 secods a new bullet comes from a random point. And if the bullet is clicked it should disapear and a pop like an explosion should appear. And ...
0
votes
0answers
14 views

java.lang.IllegalStateException Exception, when creating bufferstrategy [closed]

I'm currently trying to develop my own game engine but I've run into the java.lang.IllegalStateException Exception which has been bothering me for hours now and I thought someone here might be able to ...
1
vote
1answer
97 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
2answers
145 views

OpenGL ES 2 jittery camera movement

First of all, I am aware that there's no camera in OpenGL (ES 2), but from my understanding proper manipulation of the projection matrix can simulate the concept of a camera. What I'm trying to do ...
-2
votes
1answer
43 views

libGDX How to make camera follow the player? [closed]

I'm having some trouble getting the camera to even work at times. Thankfully, its some-what working now. I'm trying to get the camera to follow the players movement but nothing happens. (cut out the ...
2
votes
2answers
600 views

How to load chunks of 2d map segments when player reaches a certain point?

In my 2d platformer (made with Java and Slick2d), random maps are made by combining different segments together and displaying them one after the other. My problem is that I can't load too many ...
0
votes
2answers
294 views

How do I add an image inside a rectangle or a circle in JavaFX?

Suppose we have a rectangle called r Rectangle r = new Rectangle(40, 20); and an image called image Image image = new Image("...src for image"); How do I fit the image inside the rectangle? ...
0
votes
1answer
291 views

Java Slick2D - Problem using ScalableGame class

I am having a problem adjusting the size of the screen while using the ScalableGame class from the Slick2D library. I would like the background and objects (images and graphic shapes) to adjust to ...
1
vote
0answers
26 views

LibgGDX drawing two seperate Textures in FrameBuffer

So I am trying to combine multiple TextureRegions in to one by using a FrameBuffer. This works extremely well when the TextureRegions originate from the same Texture object/file but as soon as I try ...
0
votes
4answers
135 views

How can I optimize performance when updating tiles?

So I'm making a side-scrolling adventure type game in Java. The worlds are procedurally generated, so I can't manually place tiles. Therefore, I every 20 ticks (1/3 second) I update every block's tile ...
0
votes
1answer
261 views

Java 2D World: Convert from mouse screen co-ords to screen co-ordinates?

I have a 2D world background made up of a Grid of graphics, which I display on screen with a viewport (800x600) and it all works. My question is I have the following code to convert the mouse ...
-1
votes
0answers
29 views

Multi-Textured Blocks

I have some code from watching EsvDefCon's video on how to make blocks MultiTextured, but it failed. Here is my code public class multiTextureBlockTemp extends net.minecraft.block.Block{ // you ...
0
votes
0answers
24 views

Redundant shape when drawing [closed]

I have written a piece of code that when the mouse enters the mainArea, the blue "Pause" text with a rectangle appears. However when I run the program and when the mouse enters, an additional black ...
0
votes
0answers
53 views

Java Libgdx - Fire bullets

This is my project structure! I am using Java Libgdx I want to make my Man class shoot the bullets from my bullet class. To make it more clear for example the spaceship game that you shoot ...
0
votes
2answers
927 views

Perspective camera for 2D

I'm very new to LibGDX and I'm trying to use DecalBatch with PerspectiveCamera, simply to have Z-coordinate for my sprites, as SpriteBatch does not offer that. However, I don't know how to calculate ...
0
votes
1answer
600 views

libgdx actors and instant actions

I'm having trouble with actors and actions. I have a list of actors, they all have either no action, or 1 sequence action This sequence action has either : a couple of actions (some are instant, ...
0
votes
0answers
12 views

Class or Interface expected cocos2d-android [migrated]

I'm trying to use cocos2d-android in Android Studio following this tutorial, the problem is that I'm unable to add at myactivity.java: protected CCGLSurfaceView _glSurfaceView; Because ...
0
votes
1answer
130 views

Grid collision - finding the location of an entity in each box

I am trying to implement grid-based collision in a 2d game with moving circles. The canvas is 400x400 pixels. Below you can see the code for my Grid class. What I want it to do is check inside which ...
0
votes
3answers
160 views

What is the easiest way to make an object follow the edge of a sprite?

I have a rounded rectangle sprite and another sprite that's just a circle. I want the center of the circle to follow the edge of the rounded rectangle. Is there any easy way to accomplish this task? ...
0
votes
1answer
103 views

How do I rotate and flip 2D sprites stored in a 1D array of pixels?

I am using a 1D array of pixels for rendering in 2D in java. I am interested in rotation (in radians) and mirroring across the x and y axes. The desired result looks something like this: Public void ...
1
vote
3answers
300 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 ...
2
votes
1answer
207 views

How do I split a texture into differently shaped pieces with libgdx?

I want to split a texture into variously shaped pieces with libgdx, like the pieces of a puzzle game. TextureRegion.split() is not an option, as it splits into equally sized rectangular texture ...
0
votes
1answer
724 views

How handle nifty initialization in a Slick2D state based game?

I'm using Slick2D and Nifty GUI. I decided to use a state based approach for my game and since i want to use Nifty GUI, i use the classes NiftyStateBasedGame for the main and ...
1
vote
0answers
52 views

Using xinput vibration with java

I need to use vibration for my java game, which is only available through xinput since I use xbox controllers. How can I achieve this with jna? I've never worked with dlls before so any help is ...
0
votes
1answer
212 views

libgdx ActorGestureListener.pan() parameters not moving actor in smooth line

I override the pan method in ActorGestureListener to implement dragging actors in libgdx (scene2d). When I move individual pieces on a board they move smoothly, but when moving the whole board, the ...
0
votes
1answer
96 views

How to keep track of previous scenes and return to them in libgdx

I have three scenes: SceneTitle, SceneMenu, SceneLoad. (The difference between the title scene and the menu scene is that the title scene is what you see when you first turn on the game, and the menu ...
0
votes
0answers
33 views

Handling in-game events/scripts in LibGDX?

I'm testing some RPG-like features in LibGDX, and having difficulty handling events (such as a sign that opens a text box with specific text). I have a basic prototype method to handle events, ...