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

2
votes
1answer
119 views

Efficient datastructure to store a galaxy map

I'm working on a project for an intro level Ai class, and the project I've closen is to create a simulated universe in which Ai actors play against each other economically and militarily. I have the ...
1
vote
1answer
64 views

I can't create a “trap” block

So, I am trying to make a "trap" block. It should kill the entity that will stand on it(or walk as in the code, if somebody knows how to make that it will do something while an entity stands on it, it ...
1
vote
1answer
66 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); ...
0
votes
0answers
50 views

OpenGL model rendering issue

Currently my game will not display models properly on my PC but they load right on a pc that supports openGL 3.0, and as my laptop only supports 2.1 the last model rendered will show properly but the ...
1
vote
0answers
51 views

General pointers and advice in creating inventory structure?

I am working on text-based Diablo-like RPG, where each weapon and armor has unique stats and names and there is a lot of overlap. Ie I can generate Silver Sword with 40 damage, but I can also generate ...
2
votes
2answers
74 views

how to set up health bar rect that depends on health?

I need some help with game math. What I am using: I am using java awt library. What I am trying to do: I am trying to build enemy health bar, which will display as an rectangle. I am display two ...
3
votes
1answer
78 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 ...
3
votes
1answer
58 views

Setting 4 different enemy spawn zones off screen

This is my first game, so I really appreciate all the help. I want to create four enemy spawn zones for enemies and this areas are off screen. The enemies are coming from left, right, up and down, ...
3
votes
1answer
55 views

GLSL uniforms are returning -1, but they are being used in output

I have looked this up, and found some answers and people said that if uniforms aren't important to the final output than they get thrown away by the compiler. However, in my case they are being used ...
4
votes
2answers
231 views

Smooth 1D terrain generation

So I'm pretty happy with my terrain, and the progress on my game. I just want to figure out why the terrain is so steep sometimes. Right now to generate my random seed I use this: seed = ...
2
votes
0answers
44 views

Spawning enemies in four different positions with a fixed trajectory in android game

This is my first android game, I appreciate all the help. I want to define 4 spawning zones starting from out of the screen (left, right, up and down). Enemies coming from this areas have a fixed ...
2
votes
1answer
75 views

Java LWJGL Windows 10 native files

Hello I made a simple game and I want to share it to my friend but he cant run it. I'm assuming it's because he has windows 10 and the LWJGL 2 native files don't support that (I've asumed that based ...
0
votes
1answer
91 views

Making a house in jogl java eclipse?

here's what I'm trying to do: One house, with 3 rooms, a window in two rooms, doors in the front and back of the house and into each room (the back door has to be through one of the rooms). I've added ...
5
votes
0answers
134 views

What's the best practice for a progress bar in OpenGL ES 2.0 (Android)

As the title says, what is the best practice for a progress bar in OpenGL ES 2.0 on Android ? My attempt: I make a texture (could be a single colour or otherwise), and then stretch that texture from ...
1
vote
0answers
24 views

Android native database organization

I am developing an Android native game, but I have problems with Data Storage. For a better comprehension think it like as i am developing Clash of Clans, but with Native Andorid. Now imagine I have ...
0
votes
2answers
145 views

Exponential EXP Curve | FIXED TIME -> MAX LEVEL

I have yet another experience equation question, with a slight twist. Problem Situation Player gain experience from Level 1 - 80. Time to level from Level 1 to 80 grows exponentially. There is a ...
7
votes
3answers
231 views

Why can't I patch my procedural terrain together?

I figured out how to implement a midpoint displacement algorithm to generate a map for my game. I wanted to create an infinitely large world, so I tried to patch two maps together, but they didn't ...
6
votes
3answers
227 views

Java and Steam JVM deployment

I am currently considering my options for game development and deploying to Steam Greenlight. I really like Java with libGDX, especially for its cross platform Android potential, and I understand that ...
1
vote
0answers
53 views

Is this the correct way to build class hierarchy? [closed]

Ok, so I have whole module that is in charge of generating player class in my game and after hours and hours of hard labour I came up with this hierarchy (snippets of code without making it too ...
1
vote
1answer
42 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 ...
2
votes
0answers
79 views

How to develop a good game project? [closed]

I have enough experience in both C++ and Java, since I've been working on them a lot. My graduation project is, in my case, a game (I still have almost 8 months remaining). I already took down the ...
0
votes
0answers
63 views

How do I pack my game LWJGL game into a single executable JAR with Maven?

I am trying to use Maven to manage building my LWJGL projects. The entire project needs to be packed into a single executable jar, dependencies, natives and resources included, so that can be easily ...
0
votes
1answer
102 views

Detecting collision with walls (is this a good solution?)

I'm trying to make the collision smooth (it must open the animation, but not move the character). I've implemented 'fake positions': int step = 20; fake_left_x = x-step; fake_right_x = x+step; ...
2
votes
2answers
53 views

How to stop Follow Path steering behavior when reached target?

I'm using libgdx Follow Path Steering Behavior in my top-down game. When unit reaches the end of the path, it goes to the start (not directly, but following path), then to the end and so on. How to ...
1
vote
1answer
81 views

Java LWJGL inventory using ArrayList

I'm making a game in Java with LWJGL 2.9.3 and Slick2D, and I'm working on creating an inventory. I managed to set it up almost completely, but I ran into a problem. When I'm rendering the slots, only ...
1
vote
1answer
65 views

Java Slick2d lighting using Raycasting

I am trying to make a top down view game in java using the Slick2d library, for lighting I wanted to do something like this : http://www.redblobgames.com/articles/visibility/. I was wondering if there ...
1
vote
0answers
34 views

lwjgl Move 2D projectile in direction from coordinate pair

So I am having issues getting my projectile to move properly at all, the help I have found have only made this worse and have not actually given any heading as to what I am doing wrong. Can anyone ...
1
vote
1answer
38 views

Java delaying commands in a method with time (Sys.getTime)

LWJGL 2.9.3 and Slick2D Hello, so Im making this game and its going quite well, but I cant figure this out: Ive got a 2d tile based map (wich is stored in a 2d array) and each tile has a coresponding ...
2
votes
2answers
84 views

Android libGDX FreeTypeFontGenerator exception

I am working on a libGDX project for Android. Since I added the following code, running the game on my Android phone produces an exception: final FreeTypeFontGenerator generator = new ...
3
votes
3answers
205 views

How do you structure an Item class?

I've been thinking about the structure of an Item class. There are many items which may or may not have effects in the game. For example, an item "Herb" has an effect to "Heal HP by 5". but an item ...
2
votes
1answer
68 views

How do I stop off-screen tiles of a 2D tilemap from being rendered?

I am seeing lag because I render all tiles in my map at once. How can I exclude off-screen tiles from being rendered? My tiles are 32×32 and my player is always in the centre of the screen. Here is ...
1
vote
0answers
29 views

Change gui in java game

im making a 2D Server/Client game, i have very little to no problems with the server but now i wanna work at the client. I think about using a JFrame and all the other gui classes/methods. My question ...
5
votes
1answer
257 views

Neural Network ai evolution?

I've created a small simulation game and I have a basic neural network in place, each "creature" in my game has random weights on it's nodes and they all behave differently. Their goal is to stay ...
3
votes
0answers
50 views

2D Map Editor Tiles Palette - Best suited Java Elements to use?

I'm making a 2D RTS Map Editor and here came the moment to make a Palette which is just a popup frame showing tiles to be clicked on and then applied on the map. I'm wondering which Java Elements to ...
2
votes
2answers
88 views

libGDX Error loading font file - Netbeans

I'm trying to load a font in libGDX. But I can't figure out want I do wrong. Code: white = new BitmapFont(Gdx.files.internal("fonts/white.font"), false); Error: Exception in thread "LWJGL ...
1
vote
1answer
80 views

Getting the tile over wich the mouse cursor is

Im making a tilebased game, I have the rendering, the main engine, everything setup nicely (btw Im using LWJGL and Slick). Now this is more of a math question. How do I get the tile the mouse is on, ...
3
votes
2answers
99 views

Algorithm for triangle picking?

So i found out that i need a triangle picking algorithm, i need to see if my mouse is over the triangle. I've heard what color picking is, but it would pretty much just drop the performance twice ...
1
vote
2answers
105 views

Random white lines appearing while translating rendering slick 2d images

Hmm I'm getting this weird problem that i think may be a bug with slick but when ever i translate an image in slick 2d for some reason a weird white line appears on the left side of every image like ...
1
vote
1answer
36 views

Heightmap using Simplex noise with octaves: help with parameters and interpretation

I've found a few pieces of code around, where Java code for Simplex noise (based on this widely quoted paper) was coupled with octaves to get a heightmap. However those classes/snippets are NOT in the ...
1
vote
1answer
74 views

How to detect if two sprites are being touched at the same time?

I tried this: if(spr.getBoundingRectangles.contain(x,y)){ //do this } but how to detect if the other sprite is touched by the second pointer? Then I created two Vector3 for the pointer ...
1
vote
0answers
80 views

How do I draw multiple irregular polygons with OpenGL ES?

In this post I was asking how to program a map of a Risk-like game. Now that the map is pretty coded, both client and server-side, I'd like to finally draw the map. I'll try to keep least broad as ...
-1
votes
2answers
71 views

If statement with both AND and OR Java [closed]

I have a (maybe) really basic question about if statements. If I do something like this: if (i == 0 && j == 2 || i == 2 && j ==0) { ... } Then what will happen? Something like ...
1
vote
1answer
22 views

Convert MathAtan2 angle to degrees

I use an angle to set the velocity (or direction if you prefer) of my sprite, however, I want the sprite to be heading in the same angle as I'm moving, rotating according to that angle. How I set ...
1
vote
0answers
49 views

Java: Any good, complete video series / tutorials or books with Java Game Dev in mind? [closed]

So I've been through a Java intro class recently and I still have about 3 more courses related to Java in the near future. I figured I'd start to learn about writing games with it since I'll be using ...
0
votes
0answers
23 views

JBox2D Collision Detection

how can i detect a collision between two fillOval with the physics engin?? i read the manual but i can't understand where i may write my code. i want to simulate the fall of 2 balls and catch the ...
2
votes
0answers
31 views

Pre-existing voxel tools/libraries for Java [closed]

I want to do some development using voxel data as well as rendering it. My interest is more in the project its self, rather then things like working out rendering optimization techniques and working ...
1
vote
0answers
31 views

Physics Body editor loader collision detect

In my game I use the Physics Body Editor to add custom shapes to my bodies. In my show() method I use the follownig code to create my Jetski Body: BodyDef jetskiDef = new BodyDef(); ...
0
votes
1answer
59 views

libgdx FollowPath proper usage

I'm developing top-down rpg game and got some problems using https://libgdx.badlogicgames.com/gdx-ai/docs/com/badlogic/gdx/ai/steer/behaviors/FollowPath.html I have a path (picture 1), in this case 2 ...
0
votes
2answers
83 views

Slingshot gravity effect

I am trying to make a sling-shot that fires a projectile. I want it to act like the standard sling-shot in angry birds. So far I managed to get the "pulling" effect, ie. If I draw backwards it fires ...
0
votes
0answers
31 views

Java LWJGL and Slick2D collision with 2d array based map

So I've been making this game recently in java w/ LWJGL (2) and Slick2d. I've done some stuff like the map; it's a simple 2d array it goes through it and based on what id it is its gonna draw that ...