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
1answer
38 views

How to approach rendering in a 2D Sprite-based game?

Let's assume you have some classes like Player, Enemy, Map and Tile. The first approach would be to let the things draw themself, e.g.: void render(){ player.draw(); enemy.draw(); // etc. } ...
-1
votes
0answers
27 views

Camera orbiting with Quaternions ( rotate a position vector around another vector using quaternions)

I'm interested in finding a way to have a camera orbit objects using quaternions. I have already tried and implemented this using a simpler non-quaternion method , however it isn't the smoothest and ...
0
votes
1answer
34 views

Calculate The Proper X and Y Coordinate

I have a class called Tile, the constructor takes an integer that represents the tile's type. You can load a tileset ( via loadTileset() ) which initalizes the fields - tileset numOfTiles tileWidth ...
0
votes
1answer
24 views

Grid collision - finding the location of an entity in each box

I am trying to implement grid-based collision in a 2d game with moving circles. The canvas is 400x400 pixels. Below you can see the code for my Grid class. What I want it to do is check inside which ...
0
votes
0answers
29 views

Physics Engine With Specific Requirements [on hold]

I am working on a very specialized computer game (I'm trying to do several things I have never seen before). The game requires a very specific 3D physics engine: int-64 (long) entity positions (for ...
0
votes
2answers
99 views

Create a tornado like particle movement, based on velocity

For context i'm using Java and Minecraft Forge, however the concept should be fairly standard. To spawn particles you use this function... world.spawnParticle("largesmoke", posX, posY, posZ, ...
-2
votes
2answers
51 views

How to calculate a bounding rectangle of a polygon?

Polygon poly = new Polygon(); poly.getPoints().setAll(5d, 15d, 15d, 25d, 5d, 30d); How do I calculate the Polygon's height and width? There is no poly.getWidth() or poly.getHeight() method in ...
-1
votes
0answers
18 views

How to create an invisible rectangle around a circle? [on hold]

The reason why I'm asking is so it's easier to create Grid based collision detection. So how do I create an invisible bounding box around a circle/polygon?
-1
votes
2answers
19 views

LWJGL Jumping Down [on hold]

I'm currently building a little game using LWJGL, and I got a Game class which contains my game loop, instances etc... And a Player class which contains a constructor (for x and y coords), logic ...
0
votes
0answers
15 views

Java: Using Swing for game development [on hold]

I am relatively new to game development. I have been developing games and studying game development for 2-3 months now. I use Java. I have always used Swing for my graphics (aka, the entire game is ...
0
votes
1answer
33 views

How do I move the camera in 2D LWJGL openGL?

I am making a top-down rpg game with the LWJGL but I can't figure out how to make the camera follow the player. I've tryed using GLU.gluLookAt() but it seems to be designed for 3D and when I try it ...
0
votes
0answers
10 views

Specific method gets called at weird time intervals [on hold]

I'm making a 2D game in Java. I have a specific method that moves an AI spaceship around the screen towards a specific radius from the player's spaceship. (Let's call this method FollowPlayer()). ...
1
vote
0answers
35 views

2D collision detection with Boundaries of object

Currently I have a working game in lwjgl/java, with an object(player) that moves across the screen. As it is tile-based, the player has to move around, and I need to know when it collides with certain ...
1
vote
1answer
50 views

Multiplayer game communication, sending coordinates [on hold]

While I was working on my 2D ORPG platformer game, I've got to a part where I had to do something with the player movements. The way I did first, is to send to the server player's coordinates every 30 ...
0
votes
0answers
42 views

Make circle rotate around a point [duplicate]

Circle c1 = new Circle(20); //Initialize c1.relocate(200, 200); //Set coordinates I will say right off the bat that I do not understand trigonometry. From what I've been able to find online, I need ...

15 30 50 per page