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

8
votes
4answers
3k views

Java game in a day or two

We are three people who are going to make a simple game in Java as a school project (University, first year). The game has to be object oriented. We don't have much time, 10-20 hours tops. None of us ...
8
votes
3answers
1k 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 ...
8
votes
6answers
2k views

Which server platform to choose

I'm going to write a server for an online multiplayer with these requirements: Pretty simple turn based game (think a card game) that is played entirely on the server (security reasons) Must be able ...
8
votes
2answers
2k views

Java 2D game programming: Different approaches to make a game loop

I am new to Java game programming, but the more I read the more I'm confused, because I've seen several different approaches to make a game loop: 1. The standard approach, that uses the Timer class ...
8
votes
2answers
573 views

What is the primary use of Vertex Buffer Objects?

From what I've read, it seems VBOs are purely for performance. I'm working on a very rudimentary learning project in lwjgl and I'm just trying to figure out what more advanced features of the library ...
8
votes
8answers
2k views

Best resources to learn Game Development from a Java background? [closed]

I'm an enterprise Java programmer, however something I've been interested in and what got me into the whole programming thing was the idea of being able to create a game. Just wondering if anybody ...
8
votes
3answers
4k views

Android differences (Dalvik+Java vs Old School C++)

Developing in Android is going to be different for me, having spent the last 10 years coding games in C++. What's the main differences / pitfalls / bottlenecks to developing for the Android? My big ...
8
votes
4answers
3k views

Looking for JMonkeyEngine tutorials and documentation

I'm looking for tutorials and documentation for JMonkeyEngine, beside the material on the official website. Any clue?
8
votes
2answers
746 views

How can a desktop Java game be distributed without a Java runtime dependency?

Is it possible to turn a Java application into a standalone package that runs "out of the box"? The end user should not be required to install any Java JRE, nor should the installer contain a JRE and ...
8
votes
2answers
499 views

Space partitioning when everything is moving

Background Together with a friend I'm working on a 2D game that is set in space. To make it as immersive and interactive as possible we want there to be thousands of objects freely floating around, ...
8
votes
3answers
1k views

Flash, Java, Unity plugin install penetration?

Is there data on how many users have Flash, Java, or Unity plugins installed?
8
votes
3answers
1k views

PacMan character AI suggestions for optimal next direction

Firstly, this is AI for PacMan and not the ghosts. I am writing an Android live wallpaper which plays PacMan around your icons. While it supports user suggestions via screen touches, the majority of ...
8
votes
2answers
707 views

Random Zelda-style map generation

Im trying to randomly generate a map of rooms connected by doors, and I've succeeded in generating one using this code: public void generate(GameContainer gc) { rooms = new ...
8
votes
1answer
258 views

Estimating costs in a GOAP system

I'm currently developing a GOAP system in Java. An explanation of GOAP can be found at http://web.media.mit.edu/~jorkin/goap.html. Essentially, it's using A* to plot between Actions that mutate the ...
8
votes
2answers
852 views

What is involved with writing a lobby server?

So I'm writing a Chess matchmaking system based on a Lobby view with gaming rooms, general chat etc. So far I have a working prototype but I have big doubts regarding some things I did with the ...
8
votes
2answers
1k views

Java code for client-server game on Android

I have developed a game on Android. Now I want to play it on wifi or 3G. I have game packets which I want to send form client (mobile) to server then to another client (mobile). I don't know how to ...
8
votes
1answer
474 views

Separation of world state and animation in a turn based game

How do you handle the separation of animation from the world state within a turn based game? I'm working on a 2D grid based game currently. The below code is simplified to better explain. When an ...
8
votes
1answer
462 views

Using a Higher Precision (than 8-bit unsigned integer) Buffered Image for Heightmaps in Java

I am generating a heightmap for every quad in my quadtree in openCL. The way I was creating the image is as follows: DataBufferInt dataBuffer = ...
7
votes
3answers
5k views

How much is java used in 2d/3d indie games? (before/after Minecraft) [closed]

I wonder for my own use and curiosity, how popular is Java in indie game development , in 2d and 3d? Are there any good open/closed source games done in java?
7
votes
2answers
637 views

How can I make a snake's tail follow the head?

Following an assignment and just getting started with libGDX by building a small Snake clone I've run into an issue that I'll probably be ashamed for in a little while. I currently have a snake's ...
7
votes
3answers
937 views

Effective methods to continuously update movement in a tower defense game?

We are four guys making a Tower Defense game as a project in first grade on a university. The game is going to be really simple! Three different towers Three different monsters One map (maybe add ...
7
votes
2answers
4k 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 _______.________ | ...
7
votes
3answers
2k views

Rendering only what is on the screen

I am fairly new to this world, so bear with me. I have a grid of blocks in a top-down, 2d game written using Slick. The best way to think of it is the Pokemon world. Right now, I am rendering all ...
7
votes
3answers
2k views

Should I move the world or move the player?

I'm about to start developing a sidescrolling game where the players goal is to travel as far as he can in the horizontal axis before touching down. Note that I do not need to ever travel back on the ...
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 ...
7
votes
2answers
2k views

Multi threaded game - updating, rendering, and how to split them

From the StackOverflow post (it was recommended I move this): So, I'm working on a game engine, and I've made pretty good progress. However, my engine is single-threaded, and the advantages of ...
7
votes
2answers
365 views

Java single Array best choice for accessing pixels for manipulation?

I am just watching this tutorial https://www.youtube.com/watch?v=HwUnMy_pR6A and the guy (who seems to be pretty competent) is using a single array to store and access the pixels of his to-be-rendered ...
7
votes
3answers
706 views

Is there any Card Game Framework? [closed]

Please let's avoid the discussion of creating/using a game framework or not. I would like to create a small framework for card games or use one if it exists. Does anyone knows one? Preferably ...
7
votes
1answer
201 views

Problem when scaling game screen in Libgdx

Currently, I'm able to scale the screen by applying this bit of code onto an OrthographicCamera Camera.setToOrtho(true, Gdx.graphics.getWidth() / 2, Gdx.graphics.getHeight() / 2); But something ...
7
votes
4answers
1k views

Efficient 2d Java Line of Sight for a lot of entities?

My problem today is this: I have many civilians going around, they are classes stored by an arraylist. The idea is when they see another civilian panic, they'll start to panic and it will spread. ...
7
votes
3answers
2k views

Composition heavy OOP vs pure entity component systems? [closed]

I admit, I have made the sin of overusing, and even abusing inheritance. The first (text) game project that I made when I was taking my OOP course went as far as "Locked door" and "unlocked door" from ...
7
votes
2answers
785 views

How should i have the key/mouse input in an advanced java game?

I am a self taught programmer, so I do not know the proper ways to do things. I have made simple games like asteroids and snake, but in those games, you can easily modify the variables within the ...
7
votes
2answers
575 views

What's the best way to draw lots of trees

I'm writing an app which renders a random island planted with trees. The trees are currently two quads, criss-crossed and drawn with textures. I plan to have more complex meshes that form different ...
7
votes
1answer
1k views

How to force a line break before the last word of a line reach the edge?

I'm printing a sliding text by adding each letter after a short period of time. My problem is that when the text multilines, the last word of a line starts on the current line and jumps to the next ...
7
votes
2answers
531 views

Handling commands or events that wait for an action to be completed afterwards

Say you have two events: Action1 and Action2. When you receive Action1, you want to store some arbitrary data to be used the next time Action2 rolls around. Optimally, Action1 is normally a command ...
6
votes
5answers
1k views

How do I get pixel to hex coordinates on an array based hex map?

I'm trying to make a pixel to coord function for a hex map but I'm not getting the math correctly, everything I try seems to be a little off, and examples I found were based on circled centered maps. ...
6
votes
5answers
1k views

What is Java missing that might make it difficult to develop fully-featured 2D games?

Without using any external libraries, does Java, including all officially supported APIs give you enough to develop fully-featured 2D games? The reason I ask is that I hear a lot of "bad-mouthing" ...
6
votes
2answers
3k views

LibGDX - Check if currently on Android/Desktop

I'm using LibGDX and flixel-android to build a Desktop/Android game. It feels like there should be a way of checking to see if you're currently being run on an Android device, the Desktop, and so on, ...
6
votes
5answers
1k views

How to save and restore Bullet Physics state?

I'm looking for information on how to save the runtime state of rigid bodies with Bullet Physics. Most of my world consists of static objects, but I have a few dynamic and kinematic objects as well. I ...
6
votes
4answers
793 views

Java collections and managing simultaneous operations / concurrency (java.util.ConcurrentModificationException)

Ok, so i have created my first "game" and it uses a lot of java's collections. for example, i have a bunch of monsters in a HashSet which sometimes gives me the fabled ...
6
votes
5answers
3k views

Killer Game Programming [Java 3D] outdated?

I'm thinking of picking up the book Killer Game Programming by Andrew Davidson, but its pretty old now. I know Java, and I've been messing with jMonkeyEngine for a few days now, but I'm curious to see ...
6
votes
2answers
3k 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 ...
6
votes
3answers
1k views

A-Star Pathfinding Not Giving Shortest Path

I'm attempting to implement the A* pathfinding algorithm in Java. I thought it was working well, but then I found instances where it doesn't follow the shortest path Green = start, red = target, ...
6
votes
3answers
2k views

How do I make an entity move in a direction?

I have an Entity instance which is updated every game tick. Let's just assume that entity moves forward constantly. I'd like to be able to give the entity's angle to a function that makes it move in ...
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 ...
6
votes
2answers
2k views

MMORPG server-side java architecture

I am currently making a MMORPG game, which is turn-based. The client is supposed to run on Android. Now, my friend is doing the graphics, and I have been doing the game classes (player, weaponry, ...
6
votes
1answer
2k views

How to invert background pixel's color

I'm writing a game and map editor using Java and jMonkeyEngine. In the map editor, I've got a brush done by wireframed sphere. My problem is: I want to make it visible everywhere, so I want to invert ...
6
votes
3answers
389 views

Common ways to keep up with character state in a 2D game?

I am currently developing a 2D Blockdude clone for learning purposes and am wondering about storing character state in the game. For example, the character can be facing either right or left. What are ...
6
votes
2answers
3k views

Tiled based map collision detection problem

I'm working on a tile-based Mario clone. I have implemented the tile based collision method from the tutorial http://www.tonypa.pri.ee/tbw/tut05.html. This works all fine when walking and falling. ...
6
votes
3answers
2k views

Java enum pairs / “subenum” or what exactly?

I have an RPG-style Item class and I stored the type of the item in enum (itemType.sword). I want to store subtype too (itemSubtype.long), but I want to express the relation between two data type ...