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

Need Help to add a JOptionpane list to my Java Chess Game [on hold]

Github Link to full download https://github.com/Jamiex304/Chess-Game I am currently developing a chess game and have ran into a problem Currently when a pawn reaches the end of the other side of ...
0
votes
0answers
28 views

How would you declare a Texture object in the libgdx skin json file, using a region from a texture atlas?

I have a texture atlas that is linked to my skin.json file. The atlas contains a region named "game-title". I would like to declare a com.badlogic.gdx.graphics.Texture object in the json file, to ...
0
votes
1answer
63 views

Location of “units” in Code

So, I've been playing around with the concept of a game, mechanically think of the Civilization games(Tile, turn-based strategy) but I am quite uncertain about where I should store the units location ...
-1
votes
0answers
83 views

Best programming language for game development? [on hold]

Is java the best one for this job? Or is there languages better for game development?
0
votes
1answer
62 views

Per vertex diffuse lighting not propogating across entire model

I'm not sure how to describe this problem so I've added a picture. When I add per vertex diffuse lighting to my model (just a field of cubes for simplicity) the lighting effect applies to each ...
2
votes
1answer
132 views

Avoiding memory allocation in Android game development

For obvious reasons, allocating memory on the fly in Android game development is not recommended. For example: http://developer.android.com/training/articles/perf-tips.html: There are two basic ...
1
vote
1answer
47 views

What is the relationship between glVertexAttribPointer index and GLSL location?

I've been getting some strange results when trying to implement a normals buffer for the purpose of rendering lighting. It seems to be related to the indexes for glEnableVertexAttribArray, ...
-1
votes
1answer
27 views

Screen flashing while window is open [closed]

The screen renders everything in the right place but the entire screen flickers/flashes while it's open. Any Ideas? TileMapEditor class import com.stardust.main.gfx.Assets; import java.awt.Graphics; ...
0
votes
0answers
9 views

Creating bullets at tip of rotateable object? [duplicate]

I am and not very good at trigonometry or whatever it is i'm even using. My problem is that I simply cannot figure out how to create the bullets exactly at the point of my object. The object rotates ...
0
votes
0answers
6 views

Circular references in Nation-Town-Citizens chain [migrated]

Say I have three classes, Nation, Town, and Citizen. A nation contains towns, and a town contains citizens. public class Nation { Set<Town> towns; } public class Town { ...
0
votes
1answer
35 views

TileMap not not rendering

I have a tile map that I would like to be able to move while playing the game. In the code you will see the posX and posY variables. I used these variables so that when I complete this, I can have the ...
1
vote
1answer
46 views

Rotating an object to point towards the mouse [duplicate]

I'm using slick2d for this process and trying to rotate a minigun to face the mouse. My problem is that the minigun in my game is actually rotating but no towards the mouse at all! Also, the minigun ...
1
vote
1answer
63 views

IBO interfering with VBO data?

I have a vertex and color VBO that render a plane (2 triangles) just fine. However, when I attempt to use an IBO to render the plane, the vertices are completely off. My nice square looks all crumpled ...
0
votes
1answer
30 views

Using IBO's with color

I am trying to familiarize myself with IBO's by drawing triangles etc but I'm finding no way to get the color to apply properly. Can I not use an IBO to index the color values as well? I am having ...
0
votes
0answers
19 views

How do I create a java library that is dependent upon another library? [closed]

Hello everyone, I am creating my own java library to help me when creating games. this library is just for personal development. however, some of the commands within the libarary are ...
0
votes
0answers
61 views

libgdx building 3D terrain

I've been spending a lot of my time working with libgdx scene 2d & have become very familiar with it. I've decided I want to move over to 3D & take a couple of weeks to learn & better ...
1
vote
0answers
39 views

Why does my texture-based object picking detect the wrong object?

I am a LibGDX beginner implementing a RISK-like game. I want to let the player select territories by clicking on them, but for some reason, the wrong territory is sometimes detected. The clicked ...
1
vote
0answers
54 views

How do I port a game to low-end phones?

I'm creating a 2D game using Unity. My intention is to have separate SD and HD versions of the game for Android and iPhone. However, it makes sense for me (due to information I have about my target ...
2
votes
0answers
32 views

Why do my Box2D bodies occasionally get stuck and separate forcibly?

I'm making a space game with LibGDX and Box2D. I made a video here to illustrate the issue. Verbal description: When objects collide, they sometimes get stuck together and are then suddenly separated ...
0
votes
1answer
64 views

Box2D object wont move until tons of force is used

Im making a game for android im using LibGDX and Jbox2D it is a space flying exploration game controlled with the accelerometer. so I have set the world to no have no gravity. the objects in Box2D ...
0
votes
2answers
157 views

How do I make an 8 bit sprite sheet using GIMP or Paint.NET?

I'm looking to create a sprite sheet for an 8 bit, 2D RPG I'm making. All I need to do at the moment is render in some textures. To do this, I want to make an 8x8 sprite sheet. Now, I am really bad at ...
0
votes
0answers
15 views

Projectile Motion in lwjgl with java [duplicate]

I was trying to make a game with a bow and arrow using lwjgl but I couldent get the arch right. I have a function called projectile that is updated once a frame for each arrow. my frame cap is at 60 ...
1
vote
1answer
66 views

Smooth anmiation with LibGDX

I want to move a enemy from its current position toward the mouse position in LibGDX. x, y - enemy position saveX, saveY - position where my enemy need to go(or mouse position saved at specific ...
-1
votes
0answers
38 views

LibGDX Texture width and height must be powers of two

public class Game implements ApplicationListener{ public static int WIDTH; public static int HEIGTH; private Texture texture; private SpriteBatch batch; public static ...
1
vote
0answers
40 views

JBox2D Objects moving slowly (pixel to meter conversion) (SOLVED) [closed]

This problem is solved When trying to program a game using Box2D, I ran into a problem with Box2D. I filled in pixel numbers for the lengths of the the textures and sprites to create a box around it. ...
1
vote
2answers
54 views

How do I make a pop-up window with Scene2D?

I have a main-menu screen with a logo and a bunch of buttons. When the Login-button is pressed, I pop up a dialogue asking for a username and password. This works fine, other than the "popping up". ...
1
vote
0answers
63 views

Rotating a scene around a fixed axis

I am looking for a way to move my scene so that when I translate forward/back/left right it moves directly up/down/left/right on the screen. Currently it does do that until I rotate (by anything ...
2
votes
1answer
109 views

How do I multiply two RGBA colours?

I have two RGBA integers. What procedure should I perform on them to return the multiplied colour? Do I need to split the RGBA integer into its component integers (R, G, B, A)? I'm using this for a ...
1
vote
1answer
64 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
38 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 ...
0
votes
0answers
34 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
35 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
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
82 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
87 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
587 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
45 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 ...
1
vote
0answers
41 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
103 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
83 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
2answers
61 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
93 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
62 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
106 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
113 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
82 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
89 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
165 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
1answer
57 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
76 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 ...