Java is both a popular programming language and runtime environment which allows Java programs to run unchanged on most hardware and software platforms.
0
votes
1answer
15 views
Why Is My AABB Collision Detection Not Working
I am going to be making a 3D game and I need to be able to test for accurate collision. I was able to get bounding sphere collision working (too inaccurate to be used for the whole game), but AABB ...
0
votes
1answer
28 views
Java 2D RPG Game smart pathfinding [duplicate]
Hello I have a top down survival game where you shoot bad guys(green squares). The player can collide with certain tiles and so can the mobs but I want the mobs to go around the tile if there is a ...
0
votes
0answers
43 views
Should I enforce “console” control flow? [on hold]
I have a game where the user enter commands in a JTextField to interact with the game engine (move his character, get a description of its current location, see his inventory...). The problem is that ...
0
votes
0answers
29 views
Making a player jump [on hold]
I am developing a game in eclipse for android and I wont to make the player jump like in flappy bird.I developed some code to make the player jump when the screen is touched but when I run the app and ...
0
votes
0answers
58 views
Calculating Projectile Movement
I'm having some trouble putting together a method that will constantly move a "bullet" in the same direction accurately. Here is what I have so far
public Vector3f moveFromPosition(Vector3f location, ...
-2
votes
1answer
42 views
How to spawn multiple enemies? [on hold]
I can store it in an array, ok, but after how can i paint it? Because if i do
enemy = new Enemy();
enemy2 = new Enemy();
i create two istances of the object, but afer how can i paint it?
I use:
...
-1
votes
0answers
46 views
Arcball camera rotation
I need some help adding Arcball camera rotation in my LWJGL modern OpenGL game.
Right now, I have a camera that follows the player. I want to be able to hold down the right mouse button and move the ...
0
votes
0answers
22 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 ...
1
vote
1answer
43 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
67 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
90 views
Best programming language for game development? [closed]
Is java the best one for this job? Or is there languages better for game development?
0
votes
1answer
67 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
137 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
52 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
28 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
64 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
31 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
70 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
56 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
33 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
160 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
39 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
55 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
66 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
110 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
40 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
35 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
36 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
84 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
92 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
592 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
46 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
42 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
107 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
86 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
65 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
94 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
64 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 ...