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
12 views

Inventory implementation in Java RPG

In my game (simple RPG with Java) there will be an abstract class Creature. Critter, Beast, Vampire... will inherit from Creature. But not ALL classes that inherit from Creature will have an ...
-3
votes
1answer
54 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= ...
-4
votes
0answers
43 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.
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
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; ...
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 ...
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
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 ...
-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 ...
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
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 ...
-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
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
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
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
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, ...
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 ...
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
42 views

Cant center screen between black bars

As I was trying to adapt my game to different device resolutions I ran into a problem when adjusting the game screen between the "black bars." In my case I am using the FitViewport class from the ...
1
vote
1answer
48 views

Scale around a point

I am trying to create an image editing application for the purpose of generating UV maps in my own format. I am currently working on scaling the image for the purpose of zooming. I can get the image ...
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(); ...
0
votes
0answers
36 views

Libgdx/Box2D PolygonShape has no position… well, what now?

As my prototype works perfectly fine I want to advance to more fun areas of the project and add a more complex player-character body. So for Box2D I figured I'd need multiple fixtures, like one for ...
0
votes
0answers
16 views

LibGDX ShapeRenderer graphical glitches

So drawing something static on the screen with the ShapeRenderer is fine but whenever I try to move something it starts glitching out. Here's a vine to show what I mean: https://vine.co/v/OBxFi1P2IO9 ...
0
votes
0answers
25 views

How can I create a raster from a custom Pixel array? [closed]

I have a rasterizer that I am building. It will first load a .obj file and create points to draw. Then, an image will be plastered over the wire frame and from there become an image on the next frame. ...
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
32 views

Jumping distance due to X velocity

I would just like to know if there is a way to work out the distance of a jump depending on how fast the player is going. For example if the player has a velocity X of 10 and he presses the jump ...
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 ...
-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
25 views

Camera rotation issue Libgdx

I have a OrthographicCamera and I want to rotate 90° it, but when I rotate it seems to be shifted more to the right. Before rotation: http://postimg.org/image/tc9jpq9zr/ After ...
0
votes
1answer
36 views

Fade into splash screen on game load

I'm using Slick2D and LWJGL for my StateBasedGame and I was wondering if there was a way to enter into my splashscreen on application load using a transition? I tried using: this.enterState(SPLASH, ...
-1
votes
0answers
15 views

AdMob Libgdx Full Screen Ad

favorite How can I make an AdMob ad in libGDX game ? For example I want to put small add at the bottom of some screens. but when the user loses I want to show a full screen add . any suggestions ?
0
votes
0answers
42 views

2D Game with a big block-based Map - Create for each block one block-object? [duplicate]

I'm working on a 2D game in Java which will be similar to Terraria (Mincecraft 2D). I want to generae the world-map random. The world (the ground) consists of 32x32 blocks. How I should handle all ...
0
votes
1answer
57 views

Enemy spawning problem [closed]

I've been trying to get my characters to spawn at random points through out the map. I have a camera which is following my main character (2D RPG Style) around the screen, but I want these "enemies" ...
0
votes
1answer
48 views

Coordinates issue vertical scroll Libgdx

I'm going crazy with this problem. I'll explain: I have a camera that falls down (flowing along the y-axis) which displays a TiledMap and declare the whole in this way: In the create method: ...
0
votes
0answers
27 views

Use LibGDX 2d particle editor with text?

Is there an easy way to use text in the LibGDX 2d particle editor. I want to show a score with an animation. Or must I create for each text an image (and a ParticleEffect instance)?
0
votes
1answer
26 views

Timed player collision

I'm trying to make the player loose one heart then cool down for a second after being hit. For an example if(a.overlaps(b)) { p.health--; } would lower the health while being touched. In my old ...
1
vote
0answers
28 views

LibGDX: Why look BitmapFont pixelated on a scene2d.ui.Dialog?

When I use BitmapFonts directly on the stage table, the fonts looks normal (not pixelated). But when I use the same BitmapFont with the same size on a scene2d.ui.Dialog, the font looks pixelated. ...
0
votes
0answers
36 views

Client side latency when using prediction

I've implemented Client-Side prediction into my game, where when input is received by the client, it first sends it to the server and then acts upon it just as the server will, to reduce the ...
0
votes
2answers
46 views

Libgdx, find Vector3 direction

I am using Libgdx along with Bullet physics. I have a vehicle moving. I would like to use a ray from the vehicles origin and in the vehicles forward direction. How can I create the forward Vector3 ...
1
vote
2answers
32 views

LibGDX . draw multiline text

I am trying to write a big text using BitmapFont in libGDX . But it shows on one line and the user can see only the first part of the text . How can I make that bitmapFont made new line automatically ...
0
votes
0answers
6 views

Open file with java application [migrated]

I am using Ubuntu. I would like to have a user be able to double-click (or whatever they have set to open a file) on the save file for a java game i'm making, and have the game start and automatically ...
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
53 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 ...
1
vote
1answer
50 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
116 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
33 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?