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

What component should the character movements in ecs and fsm?

In the below code, there's a FSM for CharacterState that will be handled also in CharacterSystem. The problem was, I don't know what component should hold movements data to process in CharacterState ...
0
votes
1answer
23 views

Should I use single state or multiple state of an entity in finite state machine?

In the below code, is the options I've created whether to use single or multiple states for my character or other entity. Still can't decide which one is better inf using state machines. public enum ...
1
vote
1answer
27 views

Problem in nested parent-entity relationship in ecs

In the given flow, the character is the parent entity, gun is child of character and bullet is child of gun. I've got a component called NodeComponent which has the storage of child entities and a ...
1
vote
0answers
12 views

LibGDX TexturePacker line problem

I'm trying to use a TextureAtlas for all my textures for better performance. Every time my game starts all my tiles are packed into one texture atlas. I have put following code into my DesktopLauncher ...
1
vote
0answers
32 views

Move to specified coords - libgdx and java

So I am making my bullets go to a point and travel further. Only its acting really really weird. Its like its thinking that the 0,0 location is at the top left instead of the bottom left. This is the ...
0
votes
0answers
32 views

Should I use finite state machine with entity component system? [on hold]

In the below code, is the components that is required to have a state. AnimationComponent MovementComponent AIComponent Where I'm at now: I've create a different State and Handle it using fsm or ...
2
votes
2answers
71 views

Grid-based smooth lighting

I implemented basic lighting in my game and I want to turn it into smooth lighting (like this). I'm currently tinting the tiles based on their light level and I have no problem changing it. My current ...
0
votes
1answer
53 views

Which language is more proper for game development? [on hold]

I want to make and 2D RPG Multiplayer Game I already have really good ideas but I don't know what programming language should I use. I want to know your opinion, I want something with good library, ...
1
vote
1answer
52 views

Java Game Optimizing

I'm trying to optimize my game. I've got object Handler that goes trought all objects and then render and tick them. If I have lot of objects in game game lags or don't start. Could you please help me?...
1
vote
1answer
24 views

How to draw the imagebutton and place it in the lower left corner

I have the button: soundBtnStyle = new ImageButton.ImageButtonStyle(); soundBtnStyle.up = skinBac.getDrawable("on");// soundBtnStyle.down = skinBac.getDrawable("off"); // soundsButton = ...
0
votes
0answers
28 views

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

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

Chartboost ads not showing on some Android Devices [closed]

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
20 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
26 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
4answers
86 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 ...
3
votes
1answer
98 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
22 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
2answers
44 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
71 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
31 views

Code review for Java multiplayer game base [closed]

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
24 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
74 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
46 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
53 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
54 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
65 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
65 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
31 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); ...
5
votes
3answers
149 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
vote
1answer
44 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 ...
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
55 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
26 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
69 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
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
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 ...
0
votes
1answer
74 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
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.
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 ...