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

How can I develop a simple Andoid game with basic 2D physics? [on hold]

I have a 2D game idea, and do not know how should I start. It is a simple game, where I should be able to stack up a lot of objects in a heap affected by gravity. Which framework (I have heard of ...
1
vote
0answers
27 views

How to rotate a sprite on touch/drag done on the screen wih Andengine?

when I look at the andengine examples I saw an example about rotate a sprite with joystick. Here is the code; final float y2 = (this.mPlaceOnScreenControlsAtDifferentVerticalLocations) ? 0 : y1; ...
1
vote
2answers
46 views

OpenGL: Properly attach Texture

Problem: Been trying for hours to set a simple png of a cross hair as a texture (so I could later stick in the middle of the view like a normal cross hair), without luck. I'm coding in Java with ...
0
votes
0answers
11 views

Chartboost ads not showing on some Android Devices [on hold]

I had implemented chartboots ads in my Libgdx game. When I tested it, it worked properly and when I published the game it is working well on some devices, but it doesn't work on others. my friends ...
1
vote
0answers
16 views

Linking 3D Models together in libgdx (skeletal)

I'm drawing a 3D stick figure for an Android app using Libgdx and its ModelBuilder's createCylinder() and createBox() methods. In the render method I animate it by applying translations and rotations ...
2
votes
0answers
24 views

FillRecatangle set Opacity?

I have a game with "hud" which is drawn by fillrectangle. How would I fade these fillrectangles when the player is on the "hud"?
0
votes
3answers
68 views

Difference Between LibGDX and LWGJL

I've been looking into developing a small game with Java, as I am fairly familiar with it and see game development as good opportunity to improve my knowledge. When I research different libraries and ...
2
votes
0answers
76 views

Generate camera shakes in Java

How would one of these work? (If you don't know what I'm talking about, think like in a game where you shoot a big gun, and your screen bounces in the opposite direction.) I've been experimenting ...
1
vote
0answers
18 views

How do I pool a bullet in libgdx ashley ECS approach?

I'm having problem creating bullet pool in ashley ECS approach, because i'm using PooledEngine, everything is pooled. So I've done is I just use engine.createEntity(), engine.addEntity() and engine....
1
vote
0answers
10 views

Libgdx Error in Importing chartboost. sdk

I am trying to add chartboost ads, I had added the jar file to my libs but when I am trying to import the chartboost sdk it gives me error and the whole lines of: import com.chartboost.sdk.Chartboost;...
1
vote
1answer
30 views

How to use GdxAI with libgdx ashley ecs framework?

I'm planning to use GdxAI Telegraph in GdxAshley ecs framework, my problem is how I'm gonna create a telegraph component if I wanted to dispatch a message? I have created AIComponent and AISystem. ...
1
vote
1answer
68 views

Can't load png in texture

I created new project in libgdx without Android, specified for Eclipse. I added testcar.png to assests in core project, refreshed core and desktop projects, new Texture(Gdx.files.absolute("C:\\...
0
votes
0answers
30 views

Code review for Java multiplayer game base [on hold]

I have been working on writing the base for a UDP based multiplayer game in java. So far, I have written: -a base server client interaction for clients to locate servers and join them -a swing app ...
1
vote
0answers
22 views

What is the proper way of creating bullet in libgdx ashley ecs framework?

I'm still thinking, how do I properly pool a bullet in libgdx ashley? Because the PooledEngine is available, which the Entities, Components and Systems are already Pooled. I made this below example, ...
2
votes
2answers
68 views

How to pool child classes in LibGDX?

I have a super class named Monster which implements Poolable. Then I got child classes which extends from the Monster class, but I can not figure out how I will use pool and maintain only one set of ...
3
votes
2answers
74 views

Delay when moving elements

How you can see my mouse goes little bit faster than widget. My movement algorithm is: cursorPositionPrev.set(cursorPosition); cursorPosition.set(getCurrentPos()); ... Vector2f delta = new ...
1
vote
0answers
43 views

External gui within a render loop

I was wandering how easy is to interface existing Java programs/GUIs inside a game loop. Sorry if my question is a bit vague. I'll try to explain. I am currently designing a simulation environment ...
0
votes
1answer
22 views

Turning x and y difference between two points into a projectile moving between them at a fixed speed

In a libgdx project of mine, I have two units on a 2d field who want to fire at each other. They both know the x and y distance to each other by subtracting their enemies position from their own: ...
1
vote
1answer
45 views

How to minimize the repetitive creation of component in libgdx ashley?

The below example is creation of character Entity. My problem is do I always need to call these engine.createComponent(...class) to create a component? Or should I wrap these to another class that ...
1
vote
1answer
48 views

Scene Transition in libgdx

How can I make transition between stages in libgdx ? I have 2 screens MenuScreen and GameScreen each of which has a stage I write the following to make a transition : in MenuScreen SequenceAction ...
4
votes
1answer
44 views

OpenGL ES Frame Skipping causing visible artifacts

I'm using OpenGL ES 3.0 on Android 5.1, and am noticing the following issues. I tried to implement the game loop which does exactly 60 updates and do as many frames as it can. Everything is smooth, ...
0
votes
0answers
63 views

2D Map and Character Creation [closed]

I was wondering what the best solution for 2D map and character creation is? I’m looking for something like Pokémon or other top-down perspective. I’m programming in Java so far and know how to put ...
1
vote
1answer
52 views

How do I use Sprite in libgdx ashley ecs framework?

In the libgdx ashley wiki there's an example of Position and Velocity components, which is pretty easy to understand. My problem now is I don't know how do I integrate Sprite class as Component. In ...
1
vote
1answer
28 views

How to wrap ECS components to OOP in libgdx ashley?

Currently I am using builder-pattern to create my Entities PooledEngine engine = new PooledEngine(); ... CharacterComponent character = engine.createComponent(CharacterComponent.class); ...
0
votes
0answers
50 views

how to get two or more vector3f to follow each other [closed]

How do i get two or more vector3f points to follow each other with a distance? i am working with particles in 3d and already have the 3d rendering of the particles down. I'm going for an effect a lot ...
5
votes
3answers
145 views

Random black pixels GLSL shader bug

I've recently been following a tutorial for writing a game engine in Java using LWJGL 2. I followed the tutorial for writing a fragment shader that utilizes spotlights in GLSL. The example game ...
-1
votes
0answers
21 views

Sudden shutdown with IllegalStateException without doing anything [closed]

After 26 minutes leaving my app running without doing anything with it as a user, "app has stopped" window suddenly pop up and Logcat prints only this: 07-15 20:34:16.595 27361-27363/test.game D/...
1
vote
1answer
42 views

Which is the most efficient way to make the screen follow a sprite?

This is my first non-board game and I'm trying to learn a bit about 2D graphics in Java. But I don't know, how should I efficiently implement a camera to make the screen follow the main character. I ...
0
votes
0answers
17 views

What would an Animation Component in an ECS look like [closed]

Several definitions of an ECS say you should only use primitive data types, Maps, Sets and Lists to organize your data within components, now because I am trying to stick to that rules I was curios ...
1
vote
1answer
33 views

DrawString and Render graphics after custom time

I want to draw String after some second like "Boss is incoming",and after the string is disappeared i want to draw the Boss.I have the graphics and the string so my question is how to add timer for ...
0
votes
0answers
21 views

Rendering Map at point

I am trying to have the map display over the background image of my play screen and I cant find a way to have it appear to the side. I would like it to appear where it is in the example i made in ...
1
vote
2answers
54 views

Draw bug is creating a lot of Enemies

I'm working on 2d java game and I have little issues what I can't resolve. My problem is when I want to create 5 enemies with for loop, random post is creating lot of Enemies, not 5. How can I resolve ...
1
vote
0answers
25 views

Displaying an image when ScrollPane item is highlighted

I would like to have images displayed when an item in the list is highlighted as a form of a "preview" of the map that is selected. I'm not sure how i would implement this with clickListeners or ...
1
vote
1answer
19 views

click event not registered for an actor inside stacked cell within a table in libgdx

In the following code segment, the click event for image element is not registered. However, if i comment out stack.add(shapeLabel) statement, then the image button is able to register the click event....
0
votes
0answers
25 views

OpenGL Uniforms Crash When Run - Why?

Why does it not render the input vertex when I make UF variable? The program works totally fine if I don't update the uniform and keep it as a constant. #version 330 layout (location = 0) in vec3 ...
1
vote
1answer
24 views

Unable to remove class information in serialized json file using libgdx

I am encountering a problem in serializing an array of objects to json file. Please let me know where I'm making the mistake. Object to be serialized : package components; public class UserGameInfo ...
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 ...
0
votes
0answers
67 views

How to maximum height and body to move in projectile motion( on Canvas)

**Really.anybody Know't this question's Answer? ** I asked this question before, but I think I worded it badly and thus did not get any response. I am trying to use an projectile motion in my game. ...
0
votes
1answer
46 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
1answer
21 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 ...
0
votes
1answer
73 views

Put layout over Surfaceview

I have this problem: I'm trying to create new RelativeLayout over whole screen - which also contains SurfaceView in the middle - and display some things on this RelativeLayout (in my case Imageview ...
1
vote
1answer
16 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.
0
votes
1answer
29 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 ...
3
votes
1answer
63 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 ...
0
votes
2answers
35 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
0answers
31 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 ...
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
0answers
35 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
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
18 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 ...