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

How to blend two RGBA colours together using the multiply blend mode?

If I have an RGBA integer, A and another, B, what function would I perform on these to return the colour that would be expected? Also, do I need to split the RGBA integer into 4 other integers? R, G, ...
0
votes
0answers
17 views

is learning both java and objective-c for app development better or learning c++ for mobile multi-platform app? [on hold]

I want to create a games like angry bird, temple run, and write some apps like reddit. What should I do? 1) Learn java and objective-C for both mobile platform? 2) Learn C++ and various other skills ...
0
votes
0answers
36 views

How can I do a weighted cascade down a path in a 3D environment?

I am trying to perform a weighted cascade down a path in a 3D environment. Now, what I am trying to do is have one object(a cube) in the environment scan from its coords 1 in every direction for ...
0
votes
0answers
19 views

Need some guidance implementing event based game loop in JavaFX card game

i tried to make the title as much informative as possible. Anyhow, i'll try to be brief - I'm fairly new to java programming and programming altogether, after learning the basics and some advanced ...
-1
votes
0answers
22 views

I am starting to program with LIBGDX and I can not display a Texture [on hold]

So I have just started to learn Libgdx game development. I am trying to add a texture to the screen but it is not appearing when I run the program. I will post my code below. Please help. Class 1: ...
0
votes
0answers
31 views

Slick 2D - how to substract two vectors?

I have two vectors:- Vector2f enemyVec = new Vector2f(enemyX, enemyY); Vector2f playerVec = new Vector2f(playerX, playerY); According to docs, I can use the "sub" method to substract two vectors ...
2
votes
1answer
26 views

Libgdx : point that scrolls on the edge of a circle

I'm not very familiar with libgdx vectors. I want to create my own joystick-controller and I want to know how can I find the coordinates of B by using Vectors. I can calculate the radius and I have ...
-1
votes
0answers
41 views

Help! text based game [on hold]

my game is supposed to be a simple text based game, using the scanner object. I would like the game to output the users input from an array and into a txt file as soon as the user dies. Please help! ...
-1
votes
0answers
35 views

How is PokeMMO made (2D) or how they did it? [duplicate]

PokeMMO is a 2D Java Game, i wonder how they made it does some know how they did it?
0
votes
0answers
71 views

How can I make a swinging rope?

Base question: How can I make a swinging rope in box2d? Context: The idea is to have a rope where the player can grab it, swing a little bit to get more "momentum" and reach the next platform. Like ...
1
vote
1answer
73 views

Entity Component System: Store pointer in Component to Entity

I was wondering if it is a bad idea to store a pointer in every Component to the Entity which owns the Component. E.g. I have a Component "NPC". Each entity which owns this Component also must have ...
3
votes
4answers
514 views

Algorithm to verify if a shape is inside another

I have a rectangular canvas and I need to verify whether a shape is totally inside that canvas or not. The shape can be lines, ellipses, arcs, rectangles and arbitrary polygons. Does anyone know a ...
0
votes
2answers
40 views

How to move an object uniformly from one point to another at a fixed angle? [duplicate]

In my 2d java game, I need to move Point objects (as projectiles) from Enemy object to Player object in a straight line. I did some research and found out that I can use atan2(x, y) method of Math ...
0
votes
0answers
25 views

Google turn based multiplayer automatch criteria

I've set up a multiplayer game using Google's turn-based API. I now want to put some qualifiers on auto-matching and am racking my brain on how to solve this issue... I'm using GetVariant() to ...
1
vote
1answer
88 views

When Libgdx says “for Desktop”, do they mean native executables?

I want to clarify whether the Java Framework "LibGDX" can be used to compile games to native executables. The description/strap-line says "Desktop/Android/HTML5/iOS Java game development framework". ...
-1
votes
1answer
67 views

Box2D platformer: Why does horizontal movement stop jumping?

I'm writing my sBox2D game character's movement code, but my implementation of jumping is failing: When I press the Jump key, the character jumps OK. However, when I press jump and another key (like ...
0
votes
1answer
39 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
2answers
79 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
55 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 ...
1
vote
1answer
99 views

Why is there a huge update-delay in my client/server code?

I'm working on my Java game with Libgdx and having trouble with the network code. I can create a server, make multiple clients connect to it, but there is a huge delay between the player's input and ...
1
vote
2answers
92 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
76 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
73 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 ...
4
votes
2answers
155 views

How can I get a list of servers hosted by my players?

I'm writing a multiplayer 2D online game, where game servers are hosted by the players. I want to show players a list of the currently hosted game servers. How would I do that? I know how to let ...
0
votes
0answers
32 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
70 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
88 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
85 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 ...
3
votes
4answers
278 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
70 views

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

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
0answers
29 views

Collision detection bug in java applet [closed]

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
18 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= ...
2
votes
0answers
49 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
100 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 ...
0
votes
4answers
141 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
65 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
27 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
169 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
140 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
51 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
46 views

Handling in-game events/scripts in LibGDX? [closed]

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
116 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
104 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
51 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
51 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
29 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
53 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
21 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
65 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 ...