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

6
votes
2answers
5k views

How do you determine which object/surface the user's pointing at with lwjgl?

Title pretty much says it all. I'm working on a simple 'lets get used to lwjgl' project involving manipulation of a rubik's cube, and I can't figure out how to tell which side/square the user's ...
4
votes
2answers
3k views

How can I move a sprite in the direction it is facing?

I'm using Java/Slick 2D. I'm trying to use the mouse to rotate the sprite and the arrow keys to move the sprite. I can get the sprite to rotate no problem, but I cannot get it to move in the direction ...
38
votes
8answers
23k views

Is Java viable for serious game development?

Ever since I was a little kid, my dream has been to develop games. Well, now that I am older, more mature, and have some programming experience, I would like to start. However, I would like to turn ...
10
votes
3answers
6k views

Is there an algorithm for a pool game?

I am looking for algorithm to calculate direction and speed of balls in a pool game. I am sure there has to be some type of open source code for this since pool games are some of the oldest computer ...
10
votes
1answer
464 views

When and why is a Pool class needed to hold objects?

I've been studying opengl es and an example I saw was using a "Pool" class to keep track of touch and keyboard events. Could someone please explain how and why a pool class is needed. From what I was ...
4
votes
3answers
2k views

Why is my velocity decaying?

Programming in Java. Tinkering around with physics. My entities all have position and velocity. In the main loop, all I'm doing is applying gravity and bouncing off the edges, like so: // add ...
3
votes
3answers
921 views

How to Align Gun with Bullets

I have a top-down 2D shooter. I have an image of a player holding a gun, that rotates to face the mouse. Please note that the gun isn't a separate image tethered to the player, but rather part of the ...
4
votes
3answers
905 views

How can I change this isometric engine to make it so that you could distinguish between blocks that are on different planes?

I have been working on an isometric minecraft-esque game engine for a strategy game I plan on making. As you can see, it really needs some sort of shading. It is difficult to distinguish between ...
-5
votes
4answers
2k views

How to implement a 2d collision detection for Android

I am making a 2d space shooter using opengl ES. Can someone please show me how to implement a collision detection between the enemy ship and player ship. The code for the two classes are below: ...
31
votes
6answers
4k views

What is a good file format for saving game data? [closed]

I need to save some custom game data. Map, player, etc. All of them will have "sub objects". For example, a map and map will have an "array" of tiles. ie, hierarchical data. Hopefully nothing ...
10
votes
1answer
7k views

Making a HUD/GUI with OpenGL (LWJGL)

I'm at the stage in my game development where I need to make a HUD or GUI. I've never gotten to this part, so I don't know how its done. I tried rendering a simple quad at a fixed position on the ...
16
votes
3answers
4k views

Polling vs event driven input

I'm developing a game using polling for the input method. However, now that I'm delving deeper into the game menus and other UI components, I'm finding that I'd probably like to have event driven ...
2
votes
3answers
3k views

How to add a scrolling camera to a 2D Java game?

I am attempting to create a game where the camera follows the player, always making sure the player is in the center of the screen. How would I go about this? This game is a 2D Java game, made with no ...
3
votes
4answers
1k views

Which Side Was Hit?

I am working on an Android game and I have two objects A and B (both rectangles) and when they collide I simply want to know which side of B was hit. I have detected the collision fine, but I am ...
2
votes
2answers
3k views

Arc'd jumping method?

Okay, so I'm making a platformer, and I wanna know how I can make a arc'd jump easily. Like what Mario does in super Mario Bros 1. Any ideas on a simple way to accomplish this?
6
votes
2answers
2k views

How to store 2D tile-map

I want to create a 2D map composed of small tiles, that should look like voxels (eg. this just from side). I think I can make a structure like Voxel2D, that have int X, Y and some Color, and every ...
3
votes
2answers
1k views

Can you help me find resources for developing a top-down 2D game in Java?

I just started reading about games, and I'm going to develop a game where a person is moving around on a 2D map. My preferred language is Java. Is that suitable to develop games? I'm going to ...
1
vote
1answer
1k views

Making an efficient collision detection system

I'm very new to game development (just started 3 months ago) and I'm learning through creating a game engine. It's located here. In terms of collision, I know only brute-force detection, in which ...
13
votes
8answers
3k views

How do I create tileable solid noise for map generation?

Hey guys, I'm trying to figure out how to generate tileable fractals in code (for game maps, but that's irrelevant) I've been trying to modify the Solid Noise plug-in shipped with GIMP (with my ...
10
votes
5answers
2k views

2D Game dev and Java. Other possibilities than OpenGL?

I recently startet to programm some basic OpenGL stuff in Java, but OpenGL and DirectX is to much to handle and to understand for me and i'm getting bored really fast. Now i am wondering if there are ...
9
votes
2answers
2k views

How do I tackle top down RPG movement?

I have a game that I am writing in Java. It is a top down RPG and I am trying to handle movement in the world. The world is largely procedural and I am having a difficult time tackling how to handle ...
5
votes
4answers
5k views

2D Platformer Collisions

I've basically asked this question before, and I know it's been asked probably a billion times, but I still can't seem to do it. All I want to know is how I should go about doing basic 4-way, ...
4
votes
4answers
17k views

Android game scrolling background

I'm just trying to figure out the best approach for running a scolling background on an android device. The method I have so far.... its pretty laggy. I use threads, which I believe is not the best ...
8
votes
3answers
995 views

Android threads trouble wrapping my head around design

I am having trouble wrapping my head around game design. On the android platform, I have an activity and set its content view with a custom surface view. The custom surface view acts as my panel and I ...
13
votes
2answers
986 views

How do you handle uneven tiles while rendering a tile map?

Here is what I want to do with my tile map that I am unsure of. As you can see the top walls are way larger then the bottom and side ones (this is also an issue with my corners which are odd shapes ...
7
votes
2answers
3k views

Server side game loop

Many java games use thread.sleep() to controll fps. Since the server does not display graphics, should the server game loop keep running just calculating delta time? Like this example: long ...
2
votes
2answers
1k views

No LWJGL in java.library.path

Okay, so I know I need to set the path to the native files. I can do this in Eclipse, by going to the VM arguments and using -Djava.library.path=, but when I export, it says that the VM arguments ...
6
votes
2answers
2k views

How to handle pixel-perfect collision detection with rotation?

Does anyone have any ideas how to go about achieving rotational pixel-perfect collision detection with Bitmaps in Android? Or in general for that matter? I have pixel arrays currently but I don't know ...
5
votes
1answer
484 views

Smooth movement in a tile based game

How can we make our character move smoothly across tiles? He moves tile by tile, but that looks unprofessional. In addition, when you hold down the arrow keys he zips across the screen. How can we ...
5
votes
2answers
3k views

Breakout Collision: Detecting the side of collision

I am writing a breakout clone (my first game) and am totally stuck as to how I figure out which side of the brick was hit. I have a collision detection method that looks like this: ...
2
votes
3answers
4k views

Where can I find tutorials for LWJGL? [closed]

I don't know if this is against the FAQ so if you close this, it'll be no surprise. I have done research but all the tutorials I have seen have been to hard to follow; I reckon there are better ones ...
-5
votes
1answer
700 views

How to properly scroll a 2D tilemap?

Hello and I'm trying to make my own game engine in Java. I have completed all the necessary ones but I can't figure it out with the TileGame class. It just can't scroll. Also there are no exceptions. ...
12
votes
6answers
2k views

Am I hurting myself by not knowing C++ for game design?

Right now, I feel I am strong in both Java a C#. (Not much of a leap from one to the other really). While I don't expect a game designer/programmer is an attainable goal early on in my career, This ...
9
votes
3answers
2k views

How to move an object along a circumference of another object?

I am so out of math that it hurts, but for some of you this should be a piece of cake. I want to move an object around another along its ages or circumference on a simple circular path. At the moment ...
9
votes
3answers
7k views

Mods for Minecraft Server - how does it work?

Minecraft server comes as a single jar. How are mods developed? How do they interact with the original jar? What is there under the hood? What technologies are involved there? I'm mostly a C++/Python ...
7
votes
2answers
3k views

How do I find the angle between two vectors?

I have 3 points on my screen: a = a point which is (c.x, 0) makes a line pointing straight up b = a user input touch, can be anywhere on the screen c = a moving object a _______.________ | ...
6
votes
1answer
4k views

Making a camera in a 2D game (glOrtho)

I'm trying to make a camera that follows my character and it seems I've managed. However, I don't know how to limit that my camera don't follow me when my character reachs the boundaries of the ...
4
votes
3answers
467 views

Java Anti-Cheat Framework? [closed]

Are there any anti-cheating frameworks for Java games in order to make it a bit harder to cheat? (eg. something that protects from things like Cheat-Engine) Obviously if the cheater were to develop ...
4
votes
2answers
3k views

Java Slick2d - How to translate mouse coordinates to world coordinates

I am translating in my main class render. How do I get the mouse position where my mouse actually is after I scroll the screen public void render(GameContainer gc, Graphics g) throws SlickException ...
3
votes
3answers
1k views

Game Programming in java [closed]

I'm new to this site as well as new in game development, so I need to get a great start for it. Can anybody tell me from where I should start and some books or link are appreciable. What are the ...
2
votes
1answer
3k views

Managing sprite sheets for animation [closed]

I am trying to use a sprite sheet for animation but I'm having some trouble with my implementation. The three key things that I require my code to do are: Play through a set of images once, for ...
2
votes
2answers
970 views

Why does my game loop speed vary on different platforms with the same hardware?

I've got a serious issue with my game loop. This loop varies in time with the platform and with the same hardware. This is a list of FPS achieved: - Windows ======= 140 to 150 - Linux ...
5
votes
1answer
1k views

Circle-Rectangle collision in a tile map game

I am making a 2D tile map based putt-putt game. I have collision detection working between the ball and the walls of the map, although when the ball collides at the meeting point between 2 tiles I ...
4
votes
1answer
1k views

Create the right pom.xml for LWJGL and Slick Project (Maven)

can somebody tell me whats wrong with my pom.xml file? At this point i get this error if i start my *.jar file: C:\Users\Michael\git\freezing-robot\target>java -jar ...
4
votes
1answer
1k views

Android Game Dev: Screen Scaling

This question is very closely related to a previous question of mine: Scaling a game view with letterboxes? My game runs at 480x800 right now but when the screen is smaller or bigger than that I ...
4
votes
3answers
1k views

Collision Detection in Java for a game

Im making a game in Java with a few other people but we are stuck on one part of it, making the collision detection. The game is an RPG and I know how to do the collision detection with the characters ...
4
votes
1answer
1k views

New Vector Calculation for Elastic Collision of Circle and Fixed Rectangle

I am writing a fairly simple breakout-style game for Android phones. I have successfully detected the collisions between the ball(s) and bricks. The problem that I am having is in calculating the new ...
3
votes
1answer
278 views

How to implement server side physics?

I am working on 2-player 2d sidescroller. How should I implement the physics on the server? Use one world for every game or use a big world in which I add every 2 player that start a game? I have ...
3
votes
2answers
562 views

Stop map from scrolling but let player still move?

I have a basic method of scrolling around on a map (moving the map instead of the player), but at when the player gets to a certain proximity to the edge, how do you stop the map from scrolling, but ...
3
votes
1answer
1k views

Bukkit shoot tnt & help with vectors

I want to shoot a piece of tnt from the players face and then let it explode when it hits the target block. if (cmd.getName().equalsIgnoreCase("cannon")) { ...