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
votes
1answer
19 views

Box2D basic control of the player

So I have my player called "toniBody" and I am trying to get the handling controllers to work so he can move around properly on my scene. Here is how i defined my player: //CREATE TONI //body ...
0
votes
0answers
25 views

Character can sometimes walk through another, although they should always collide

I am working on a Streetfighter-styled game, 1v1. A player should be prevented from horizontal movement if they walk into the other. This is always working, except for one case. If player1 (left) is ...
-2
votes
0answers
21 views

Turn maze algorithm [on hold]

I need to write an algorithm to generate a turn maze. In turn maze games, you can rotate the maze left or right. Once the maze is rotated, a ball starts falling due to gravity until it hits a target ...
0
votes
1answer
26 views

get View from LibGDX for Android

I am making a LibGDX app, and I need to get the view to put to an Android app. Here is the code to get the view: package jangkoo.game.shadowfiend.android; import ...
1
vote
1answer
34 views

Java 2d: How to make animation only cycle once, despite control being held down?

I've been working on a 2d game, and I think I've been over-complicating how to make an animation only cycle through once. For example, if the user presses the 'a' key, the character's 'attack' ...
0
votes
0answers
30 views

X, Y, Z rotation around camera

I'm making a 3d orthogonal-projected, game using painters' algorithm in java. I'm able to rotate the objects with incremental rotations (e.g. rotate all objects 10 degrees) using affine ...
0
votes
1answer
42 views

Huge delay in a client/server

I'm working on my java game with Libgdx and i'm having some trouble with the online part. I can create a server, make multiple client connect on it but there is a huge delay between the player input ...
1
vote
2answers
73 views

How do I ensure my skybox is always in the background, with OpenGL?

I created a skybox in OpenGL (through LWJGL), but the only way I found to render it behind all objects was to make it very big. This leads to ugly edges between the 6 skybox planes. Optimally, I ...
0
votes
1answer
62 views

Weird inheritance hierarchy?

In my RPG, all Food objects should be possible weapons. For instance, I want the player to be able to to try kill bunnies with a cherry or a watermelon. The problem is that the easiest way to do this ...
1
vote
2answers
64 views

How to create Whirlpool/Vortex effect?

Im trying to make a Vortex effect on a Circle Body that is a Sensor. I've been looking for this and all examples i look for are in C++ or Objective C and i dont seem to translate them well. when my ...
0
votes
2answers
61 views

How could I host my multiplayer servers?

I have a question. How could I host my multi player game? To be more descriptive, I am developing a 2D online game. I want there to be a server list, where the player can see all of the currently ...
0
votes
0answers
26 views

How to take a screenshot with java from directX

I'm looking for a way to take a screenshot with a Java application of any running directX game. I use the following code Robot robot = new Robot(); GraphicsConfiguration config = ...
1
vote
1answer
65 views

Save a mouse coorinates after a specific number of seconds

I have a specific method that saves my mouse x and y coordinates. I want that mouse coordinates be saved by specific time (for example after 1000ms). How I need to do that in Java? Please add a simple ...
4
votes
1answer
72 views

Large 2D Arrays Causing Garbage Collection

I've been working on a game in Java that, for this post's sake, looks like Terraria and has random world generation. I've been using Vectors to contain my tile/block objects, but recently due to the ...
1
vote
1answer
71 views

How to resize my 2d game to fit the screen?

I am currently making a 2D game using Java (Java 2D). I want to make my game resizable. If you play any game on an emulator (e.g. legend of Zelda in fceux emulator) in full screen mode, you'll see ...
0
votes
1answer
32 views

Predicate methods and not logically related fields [on hold]

After getting something up and running, I want to do some refactoring (to improve extensibility). From this, two problems about composition and design arose: If Creature have a public getHealth and ...
3
votes
4answers
255 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
68 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
59 views

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

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
27 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
16 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
51 views

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

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
46 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
95 views

How to handle network game [closed]

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

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

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

Tiledmap rendering [closed]

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
4answers
130 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 ...
-2
votes
1answer
54 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 ...
-1
votes
4answers
159 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
137 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
48 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
39 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
109 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
101 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
47 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
49 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
28 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
41 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
18 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 ...
1
vote
0answers
57 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
59 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
30 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
27 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
39 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
17 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
43 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
61 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" ...