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
3answers
402 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 ...
6
votes
1answer
557 views

Appropriate level representation / data stucture for a 2D platfrom game?

I'm about to program a copy of Mario in Java. I'm thinking on 2 representations/data structures for the levels but I'm not sure which one should I choose: A 2D integer array. A quadtree to divide ...
6
votes
4answers
746 views

Profiling server side game loop in java

I am looking for tips to profile the server side game loop of a Java program for CPU usage. I tried to use the TPTP plugin for Eclipse so far. The problem I am having is that it is really slow. For ...
6
votes
1answer
5k views

Is libgdx fit for 2D game development on Android or are there simpler alternatives?

I'm looking for a Java framework to develop 2D games on desktop and Android. I've looked at Slick and I really like the API, however the developer himself says if you want a framework for Android and ...
6
votes
2answers
797 views

Is it possible to implement Steamworks functionality in a Java game? How?

I have a basic game that I want to eventually turn into something better. The game is all Java as of right now, but I want to implement the Steamworks SDK into my game (so it can have achievements, ...
6
votes
1answer
319 views

2D Polygon Triangulation

I am creating a game engine using the JBox2D physics engine. It only allows you to create polygon fixtures up to 8 vertices, To create a body with more than 8 vertices, you need to create multiple ...
6
votes
1answer
1k views

SQLite in libGDX

Does anyone have an example of how I can use SQLite in libGDX? I have a class in my original Android code that allowed me to easily access a database but I can't seem to find anything equivalent to ...
6
votes
2answers
930 views

How to loop over a part of an ogg vorbis stream?

I'm successfully streaming ogg vorbis data to openAL with the Java library JOrbis, but now I want to loop over a part of this stream, e.g from 30" to 1'30". I thought that at the end of the loop, I ...
6
votes
2answers
541 views

An odd performance problem rendering a simple scene (less than 14k vertices) in OpenGL using two vbos with LWJGL

Problem I have been having a strange degrading performance issue rendering a simple scene containing two "chunks" of 4x4x4 cubes each. Video of problem This is a screen capture showing my console ...
6
votes
1answer
693 views

Finding which tiles are intersected by a line, without looping through all of them or skipping any

I've been staring at this problem for a few days now. I rigged up this graphic to help me visualise the issue: http://i.stack.imgur.com/HxyP9.png (from the graph, we know that the line intersects ...
6
votes
1answer
745 views

Is Java AWT suitable for 2d game rendering?

[Reposting this question from stackoverflow, as it was pointed out that it fits better here.] I'm currently porting my 2D game engine to Java. I looked at some of the game libraries pointed at here ...
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 ...
6
votes
4answers
447 views

Implementing AI to hide behind obstacles

I am developing an AI simulation of predator and prey. I would like to simulate the AI hiding behind obstacles, if it is being chased. But I am still trying to figure out the best way to implement ...
6
votes
1answer
908 views

Minecraft Mod portable torch/lantern

I have just started making a mod for minecraft, I learned how to make items and import custom png's and have gotten all of that to work. I have been searching around the code trying to find a way to ...
6
votes
2answers
361 views

Where can I find some beginners to learn and work with? [closed]

I am very new to game programming. I am currently studying Java (Android mainly) and I know what it takes to make a game, as well as how to render it via OpenGL. Finding some others at nearly my level ...
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 ...
6
votes
1answer
732 views

For 2D tiled maps is all object and NPC data loaded into memory when the map is loaded?

I'm creating a text RPG in Java, but I think this applies for a GUI as well with regard to the data structure. Each Level is a tiled map. Each Tile object has an (X,Y) coordinate, and references to ...
6
votes
2answers
845 views

Are there any game engines in C# or Java that are cross-platform and support multitouch input? [closed]

I'm looking for game engines (particularly 2D) that can run/create games for Windows, Mac, and Linux, and support multitouch inputs and gestures. I'm able to find many that meet the first two ...
6
votes
3answers
3k views

How do I render a PNG with transparency in LibGDX?

I'm building a simple tic-tac-toe example with LibGDX. I have simple images: cross, circle and board, all pngs created with GIMP with a transparent background. How can I render them as a Texture with ...
6
votes
1answer
244 views

How to debug framerate drops with VBOs, OpenGL

I'm working on an experimental app to test how VBOs perform when rendering a minecraft-like world. If the performance is better than what I use now I'll update my actual game. Based on what everyone ...
6
votes
2answers
432 views

Scalability of multi-threading in game server

What is a reasonable number of threads for a simple 2D mmo in Java? Is it reasonable to have two threads per connection, one for the input stream and one for the output stream? The reason I ask is ...
6
votes
1answer
938 views

Method of terrain in a 3d RPG

I am working on a RPG using the JMonkey engine. While I was conceptualizing the map, I realized I would have a problem with the terrain. My problem is this: I want to have a click to move interface, ...
5
votes
5answers
1k views

Do I really need to “learn” C# for XNA if I know Java?

I want to start developing in XNA. As of now, I do not know C#, but I would consider myself "good" at Java. I have looked at some C# code and it looks almost identical to Java. After looking at Java ...
5
votes
3answers
671 views

Is this really the reason for smoother movement?

Actually i'm watching a tutorial series on youtube about 2D Game programming in Java. My question is about the player-movement. The first version: public void keyPressed(KeyEvent e) { ...
5
votes
2answers
703 views

One Dimensional Perlin noise vs Multi-Dimensional

I am reading through a book called "The Nature of Coding" and I am working on porting the examples from Processing.js to Regular old Java. The example I am on uses the following method call in ...
5
votes
6answers
2k views

Is it possible to use Java as a scripting language?

Is it possible to use Java as a scripting language for a C++ engine/game? I understand that you need to make a binding to the interpreter, but I haven't seen any around.
5
votes
3answers
222 views

Serialization of objects problem

i have a problem with serialization (saving and loading game variabiles), when i save evreything seems to be saving correctly but when i try to load it only detects first 3 objects i saved and the ...
5
votes
4answers
839 views

Drawbacks of using reflection for a component based system at loading-time

I'm coding a little casual game in Java using Slick2D. This game use a lot of different "objects", managed in a composite way. So, firearms, furniture in the map, NPC and player character will be ...
5
votes
3answers
2k views

GameState management hierarchical FSM vs stack based FSM

I'm reading a bit on Finite State Machines to handle game states (or screens). I would like to build a rather decent FSM that can handle multiple screens. e.g. while the game is running I want to be ...
5
votes
2answers
2k views

How do MMO servers communicate with players who are behind a NAT?

I'm now planning to develop a real-time mmo in the future using udp as the transmission protocol since it has lesser overheads than tcp... I understand that between the client and the server, they ...
5
votes
5answers
3k views

Is there a cross-platform special directory I can use for game save files?

I'm developing with LWJGL and Java on a Windows 7 laptop. I've successfully set up saving to the %appdata%\gamename\saves\ or long form c:\users\user\appdata\roaming\gamename\saves\ folder by using ...
5
votes
3answers
3k views

A more sophisticated ball-paddle collision algorithm for Breakout?

I have a simple breakout game I'm working on. The collision code is solid; things bounce as they should and don't pass through things or do other funkiness, but the reflection is a bit simplistic. As ...
5
votes
3answers
687 views

Programming Languages Recommendations: A Space shooter game that allows two people to play [closed]

Do you remember an arcade game, that allowed two people to versus or play each other? It was a Galaga/Gradius type game. Me and a couple of other people I know want to make a game like this. We want ...
5
votes
4answers
2k views

Should each Entity have its own update and render methods?

First, the questions: Should each Entity (which are classes like Character, Tree, Enemy) have its own update() and render() methods? If that's the case, then should I use Interfaces like ...
5
votes
2answers
1k views

Sprite batching in OpenGL

I've got a JAVA based game with an OpenGL rendering front that is drawing a large amount of sprites every frame (during testing it peaked at 700). Now this game is completely unoptimized. There is no ...
5
votes
4answers
937 views

Better way to generate enemies of different sub-classes

So lets pretend I have an enemy class that has some generic implementation and inheriting from it I have all the specific enemies of my game. There are points in my code that I need to check whether ...
5
votes
2answers
458 views

How does this formula for generating water waves work?

I have been trying to implement the wave equation described in this paper ("Water Simulating in Computer Graphics," Kai Li and Liming Wu) in Java. Part of the paper discusses modeling waves as a sum ...
5
votes
2answers
746 views

3D models on 2D tilemap perspective when scrolling

I am creating a small top-down game, where the player traverses a 2D tilemap, with an illusion of depth provided by 3D models for things like buildings or trees. Having gotten to the point where I ...
5
votes
2answers
890 views

Is it legal to pack LibGdx libraries in my jar file? And to obfuscate them?

I'm using LibGDX and deploying a runnable jar file, using the Eclipse feature, with libraries extracted into it. There are also .so files and .dlls inside. 1 . Is it legal to do so? I didn't find ...
5
votes
4answers
335 views

What version of Java should I target for applets?

I recently deployed an applet that seems to require Java 6 Update 24. I assume the reason for this requirement is the matching JDK version I used to create the applet (I am new to Java). The fact ...
5
votes
2answers
895 views

Disadvantages of using multiple versions of OpenGL in LWJGL?

So, I'm trying to figure out LWJGL, and my goal is to use OpenGL 3.2 (because pretty shaders are pretty). But in every tutorial I can find for LWJGL, they import a bunch of different OpenGL versions ...
5
votes
1answer
706 views

Particle System OpenGL (ortho)

I want to implement a particle system in my game but i have no idea where to start :S I've never programmed a particle system, so this is my first time >.<. I only want to display pixels ...
5
votes
2answers
1k views

How To: Java Game to Steam Greenlight

I am planning to create an indie game using Java and Eclipse IDE and I want to put the finished product to Steam Greenlight. How does the whole process work after the game is finished and running ...
5
votes
5answers
7k views

Moving from XNA to Android

I've been using XNA to learn game programming for some time, and I'm interested in moving to Android. Having said that; the learning curve to get started seems to have ramped up exponentially. I ...
5
votes
2answers
470 views

Physics in my game confused after restructuring the Game loop

I'm on my way with making a game in Java. Now I have some trouble with an interpolation based game loop in my calculations. Before I used that system the calculation of a falling object was like ...
5
votes
1answer
2k 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 ...
5
votes
5answers
1k views

How to get more than one window in Java LWJGL

I'm trying to write a game in Java LWJGL. And I need more than one (multiple) display window. By default I've got one display window where I can draw everything. But I'd like to split some data to ...
5
votes
4answers
6k 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, ...