Java is both a popular object-oriented 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
42 views

Sprites Positons

I create my sprites for 800x480 and position them accroding to this On dealing with multiple resolutions I use a method that set sprite size and position according to the current resolution instead ...
1
vote
1answer
267 views

Switch beetween Screen on LibGdx application

i have set main class like this: public class MyClass extends Game { MenuClass menuClass; ActionGame actionGame; @Override public void create() { menuClass = new MenuClass(this); ...
2
votes
2answers
343 views

Laggy empty project at 60FPS

@Override public void create() { batch = new SpriteBatch(); img = new Texture("badlogic.jpg"); } @Override public void render() { Gdx.gl.glClearColor(0, 0, 0, 1); Gdx.gl.glClear(GL20....
0
votes
1answer
50 views

JAVA: How do I use BufferedImage to properly render a PNG with Transparency?

I've been around the internet for about 5 hours and found no solution to my issue, so hopefully someone will help me. So' I've been trying to make a simple game. In previous oportunities I've used ...
0
votes
2answers
65 views

Drawing from an ArrayList drawing same image repeatedly (Slick2D)

This is the game I'm working on. I isolated the problem into this class. public class Runa extends BasicGame { int startTime, tracker; public ArrayList<Circle> circ = new ArrayList<Circle&...
5
votes
4answers
1k views

tic tac toe computer opponent

I am just starting to do some very very very basic game dev(in java), i'm trying to create a game of tic tac toe but i am having some trouble implementing an a computer opponent.I just wanted to know ...
3
votes
1answer
113 views

LibGDX: Is it necessary to set a stage as an input processor when creating a touchpad?

I mean, I've been searching it, they always use set a stage as an input processor after they had added the Touchpadto the Stage because it extends from Actor indireclty(it extends from Widget that ...
4
votes
2answers
229 views

How do I induce collision events in LibGDX 3D?

In the code below I've put an example of something I want to do. I have the camera and I want it to stop moving whenever it hits one of the boxes, how do I do this? public class Main extends ...
1
vote
1answer
149 views

How to map texture to shape in Slick 2D

I need to map texture to shape. Texture: This is a example of shapes I need to map texture to: Notice that each piece in mesh has exactly 4 point to map texture. Logic is pretty straight forward:...
1
vote
1answer
172 views

Correct way to integrate scaled axis angular velocity into a quaternion

Across my travels on the internet I have came across to ways of integrating a scaled axis angular velocity into a quaternion. The first way converts the angular velocity into an axis angle quaternion ...
0
votes
1answer
22 views

LibGDX Image Outline Help

As I was working on some art for my project, I decided that I should add an outline around some objects. So I tried my method; which was to create a second image slightly larger than the first, make ...
1
vote
1answer
98 views

How to replace tiles in Tiled in AndEngine?

in my Game I Create object layers and interpret the shapes in the engine as collision objects...now I want when Player collide with object, after a few seconds object falls...this works properly but ...
3
votes
3answers
319 views

Gradual rotation of an object in Java

I'm using Java to learn some movement algorithm. I would like to implement the "wandering" algorithm, but in order to do it, i should understand how to rotate an Object gradually. Actually, my Player ...
1
vote
1answer
74 views

Java game LWJGL input doesnt work properly

Im making a game in LWJGL 2 and Slick2d. Im trying to add an item to my inventory by releasing a key (the inventory system works properly, the part where I have to see if the button was RELEASED is ...
1
vote
1answer
2k views

Minecraft - How do I check if someone has a clear inventory

How do I check if a player has a clear inventory? I'm making a PvP arena plugin but I need it so when someone types /pvp join, it checks if they have a clear inventory. If they do have a clear ...
1
vote
1answer
17 views

Bukkit Scheduler not in main Class

I want to make an Repeating Task whisch isn't in the main Class. ("Bukkit.getScheduler().scheduleSyncRepeatingTask(this, new Runnable() {},20,20);") But it says that it can't resolve the method.
1
vote
1answer
73 views

2D BoundingBox Collision Detection Problem

I implemented collision detection into my game (using Bounding Boxes) The character is floating above the blocks instead of standing on them. I know what is happening, but I can't figure out how to ...
1
vote
1answer
95 views

Understanding HingeConstraint in jBullet

I'm using the java port of BulletPhysics engine jBullet. I'd like to make a joints between 2 triangles so that one edge of the first and one edge of the seconds act like a hinge. But I don't ...
0
votes
1answer
31 views

libgdx - Should I use OOP in ECS framework? [closed]

For example I have OOP class of Bullet and I have created the pool and factory. Should I convert it to componet based? Like BulletComponent, then handle by BulletSystem? by the way I'm using Ashley ...
0
votes
2answers
37 views

How would I make my position interpolation stop once the destination is reached?

I would like to implement tile-based grid movement and I've heard that linear interpolation comes handy in the implementation process. I've tried to use it but I'm not sure how to make it stop once ...
1
vote
1answer
28 views

Java - Performance problem with BufferedImage and AlphaComposite

:) I'm currently making a 2D platformer game and now I want to implement Light using AlphaComposite. For creating the lights I first create a blank BufferedImage with ARGB format. After this, I ...
3
votes
1answer
66 views

Why does every texture drawn cause a new draw call?

I'm currently working on a 2d sandbox tile game in LibGDX and I noticed I had 700+ draw calls. So checked my code and I could not find anything that would cause a new draw call. All the tiles are ...
1
vote
0answers
19 views

Rectangle in object-layer has wrong coordinates in game

I extended the SuperKoalio LibGDX Example about an Tiled Object Layer in the Tiled Level-Editor and draw a rectangle on this layer. Now I would like to draw this rectangle in my game using the ...
0
votes
1answer
484 views

How to use Java 8 with Lib GDX in IntelliJ?

I have set the jdk to Java 8 and I have modified all the build.gradle files in my project to have sourceCompatibility = 1.8 instead of 1.6. My problem is that while it does work on Desktop it doesn't ...
1
vote
0answers
34 views

Libgdx final stage of adding admob to game

I had finished my game and wanted to add Admob ads to the game. I followed all the instructions in Admob in Libgdx and It's working very well, and the ads are shown properly, I just wanna be sure ...
4
votes
1answer
544 views

Drawing fonts with LWJGL3 with OpenGL

I'm very sorry if this question has already been answered, but since I've been struggling with this for many days I thought I'd give it a shot here. My goal is to somehow render some text on the ...
0
votes
2answers
841 views

Move Box2D body towards mouse click

In a top down game using Box2D, I would like the player's Box2D body to rotate towards the mouse click, and then move to a point on mouse click (move, not teleport). I have worked out the rotation ...
0
votes
2answers
179 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
2answers
39 views

LibGDX - Bundling Files

I have 3 files. A JSON file, a PNG file, and a TXT file. Is there any possible way I can put all three inside a common file with a custom extension? (for example "fileName.abc") I searched the web a ...
2
votes
1answer
45 views

Binding tiles with Rect

I'm having trouble binding tiles with Rect. I've successfully bound other objects (such as the player, trees etc) in my game with rectangles but I'm unable to do the same with the tiles and I don't ...
1
vote
2answers
132 views

Java 2D Game - Screen Images Flashing

I'm currently working on a 2D Java Game. When I start the game everything works fine. A constant Update- and Framerate. When I'm using normal graphics methods to draw shapes nothing happens. But as ...
2
votes
1answer
300 views

Minecraft Modding - How do I use OpenGL stencil functions alongside the game's GlStateManager?

Note: I am using Minecraft Coder Pack 9.10 for game version 1.8.0 (official release). I am trying to make a multiline text field similar to the game's original net.minecraft.client.gui.GuiTextField. ...
0
votes
0answers
37 views

LibGDX - Parallax scrolling background help

I've been trying to do a parallax scrolling effect on my 2D side-scroller game, to give the illusion of depth, by having layers at different speeds. Basically, I have a camera that follows the player....
0
votes
0answers
26 views

Uniform Interpolation?

In currently developing a little local Multiplayer game. In using Interpolation to make the player and entitys move smoothly but there's one problem, im using Interpolation, that looks like this ...
0
votes
2answers
86 views

Round position to center of current grid position

The title may not make sense, nor may the question - I'll try nevertheless. I'm attempting to make a game similar to The Powder Toy. Essentially, this is a physics simulation game, where the users ...
1
vote
0answers
40 views

Having problems drawing entities the right way in my isometric game

I am making an isometric game where I have moving Entities's not bound to tiles, and a 3d ArrayList map which is populated by Block's which forms a tower-like structure in the middle of the map. My ...
0
votes
0answers
36 views

How to scale the camera

I'm developing a game engine (for the sake of knowledge) using OpenGL ES 1.x (Android). And there is a problem with scaling. To ensure that all textures are displayed correctly on various devices I ...
1
vote
0answers
61 views

How to implement A* pathfinding for enemies to follow player

The enemies in my game are supposed to follow the player in order to cause damage to it. Right now I have it where the enemy just goes in the direction that will bring it closer to the player, and ...
1
vote
1answer
49 views

Catch an exception from other programs

I was wondering if there was a way I could listen to all exceptions that are thrown into the console and log them somewhere or catch them. For instance: I have program A that is run by a Bukkit/...
4
votes
2answers
1k views

Matrix rotation wrong orientation LibGDX

I'm having a problem with matrix rotation in libgdx. I rotate it using the method matrix.rotate(Vector3 axis, float angle) but the rotation happens in the model orientation and I need it happens in ...
3
votes
1answer
186 views

Creation of a tiled map editor polyline in box2d is not working correctly

I'm currently trying to create a box2d polyline object in my libgdx game, but it's not working as expected. To get a better picture of my subject, have a look at how it should look like, and how it ...
1
vote
1answer
96 views

How to handle two players playing on one keyboard with Box2D (LibGDX)?

I'm making a racing game with LibGDX and Box2D. I've been using this tutorial to implement the basic physics, and it works properly. My main problem is to implement two different sets of keys (UP-...
0
votes
1answer
25 views

Object orbitting 2D circle java

I'm using this code to make a square that orbits a circle . When i use it however the rect(); is quite far away from the circumference of the circle, i would like to make it closer. All variables are ...
-1
votes
0answers
23 views

Make a 2D shape “orbit” a circle which has already been drawn in JAVA [duplicate]

I Have a circle, I want to make a shape (for now just a rect();) orbit around that circle. The x position of the circles center is represented by XPos and the y by YPos, the radius is represented by ...
1
vote
1answer
226 views

Java OpenGL Perspective matrix not working

I'm trying to render a simple triangle with OpenGL in Java using LWJGL3. Everything is working great, but the projection matrix (perspective) is not working. In C++ I just used to apply the glm::...
0
votes
2answers
663 views

Basic 2d platform collision detection algorithm has a slight bug (Java)

I'm trying to implement collision detection between Player (the main character) and a Platform. They are both modelled as rectangles; when player hits the side of a platform he should bounce off it ...
2
votes
1answer
60 views

Slick2D Networking Crash

This is my first post, so I apologize if it's been put in the wrong place or something. Anyways, here's my problem: I've run into an issue with running my client-side code in one of my game-states. ...
1
vote
0answers
19 views

How to communicate with LibGDX HTML5 app?

I'd like to have a HTML form send data to a LibGDX game deployed as HTML5. Ideally as a form in HTML as part of the same page that contains the LibGDX div/canvas, and use the form to set up some data ...
1
vote
1answer
82 views

Centering an animation [libGDX]

I have the following class: public class AnimationDemo implements ApplicationListener { private SpriteBatch batch; private TextureAtlas textureAtlas; private Animation animation; ...
3
votes
2answers
155 views

Rotate sprite along the angle between two objects

Im trying to make flames follow my object, I set the direction for my moving object using the points between it and another object (using static destination for testing). No matter what I do I ...