Java is both a popular object-oriented programming language and runtime environment which allows Java programs to run unchanged on most hardware and software platforms.

learn more… | top users | synonyms

1
vote
3answers
3k views

How do I load tmx files with Slick2d?

I just started using Slick2D and learned how simple it is to load in a tilemap and display it. I tried atleast a dozen different tmx files from numerous examples to see if it was the actual file that ...
3
votes
1answer
3k views

Stuck trying to decompress sections in Minecraft Anvil files (.mca)

I've been trying to write some Java code to read .mca files, based on the information at http://wiki.vg/Map_Format and http://wiki.vg/User:Sprenger120 . I am at the point where I can read in the ...
2
votes
1answer
737 views

2D RPG - Character sprite size bigger than tile size

Ok so I'm trying to make a nice little RPG game in Java & Slick2D engine, the tiles are 16x16, so the collision array is also 16x16, how ever my character sprite is 16x20 What would be the best ...
7
votes
2answers
7k 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
2answers
690 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 ...
0
votes
1answer
164 views

How should I detect whether or not to enable Anti-Aliasing?

How can I detect the speed of the user's graphics card so that I can decide whether or not to enable advanced graphics features that would slow down the app on a slow card, such as anti-aliasing? I am ...
3
votes
2answers
506 views

Would it be too much overhead to keep a HashMap of variables on a server per object for the purpose of syncing object changes with the client?

I am currently writing a server for a multiplayer game. I am trying to find a good solution for synchronizing GameObjects across the server. The server sends each client a snapshot of every object in ...
1
vote
2answers
763 views

CCSpriteFrameCache: Frame '%s' not found

I have just started using the Cocos2D library for Android. I am trying to make a walking bear animation. For that I am using a CCSpriteFrameCache, but I'm getting a "frame not found" error in the ...
0
votes
2answers
1k views

Java OpenGl Rotating Cube Problem!

OK, so I successfully learned how to bind textures to quads and display this cool looking crate. However, when I rotate the cube something goes wrong. During rotation the back-face of the cube ...
1
vote
0answers
145 views

Ardor3D creating items such as guns…? [closed]

I am using Ardor3D as a game engine, but I can't seem to find anything anywhere about creating items that the player holds. My game is in first person. I want to make a gun that is always visible on ...
2
votes
1answer
927 views

Problems with moving 2D circle/box collision detection

This is my first game ever and I'm a newbie in computer physics. I've got this code for the collision detection and it works fine for BOTTOM and TOP collision.It miss the collision detection with the ...
-2
votes
3answers
389 views

Client Server what do i need?

Simple question if the Client is Android Game App That send data to the server for Storing/Recalling Data as well as calculating data? I hear sql is good for simple database stuff.what is good for ...
1
vote
2answers
2k views

Provide A Scrolling “Camera” View Over A 2D Game Map

I'm in the process of attempting to create a 2D MMO type game with Kryonet and some basic sprites, mostly for my own learning. I have the back end set up great (By my standards) and I'm moving on to ...
0
votes
2answers
286 views

In regards to applet games and UDP [closed]

I've got about a year in Java experience, and would like to set up a server and client for an applet game. However, there doesn't appear to be any tutorials out there on anything like I want to use. ...
1
vote
1answer
577 views

Random Sprite Speed

I followed the Rain Catcher tutorial from libGDX and I made some modifications to the code, allowing the rain drops to appear faster. But I cant figure out how to make the raindrops fall at random ...
1
vote
1answer
1k views

Android APK export duplicating libgdx assets folder

I'm developing a game using libgdx targetting Java desktop and Android. For the assets I have a "data" folder inside the "assets" folder in the Android project. Then, I link it from the desktop ...
-1
votes
1answer
182 views

Looking for java project to join [closed]

I am pretty new to java, and im mainly doing this for experience and learning. I would like to join a java game, with nice people to work with. It would be great if it wasnt too long in devolopment, ...
1
vote
1answer
2k views

Best way to create a level editor in java [closed]

I am creating an iPhone game using cocos2d + box2d that needs a lot of levels. My friends and I are creating the game and most of them have no programming experience and end up with nothing to do. I ...
1
vote
2answers
395 views

What is a library for event-driven mouse and keyboard input in Java?

The title basically says it all. The only thing to take into consideration is it needs to be cross platform.
0
votes
2answers
745 views

How do I move a sprite around using tile based movement in Java?

So, I'm new to Java and I want to get a sprite to move around the screen, like a tile-based movement. I really would like some help and some resources or tutorials could work. I've done a little C#, ...
0
votes
1answer
1k views

Virtual screen size with libgdx and GLES 2

I've been trying to use a virtual screen size for my libgdx desktop-android game. I'd like to always use a 16:9 aspect ratio but with a virtual screen size so everything would adapt automatically ...
2
votes
1answer
306 views

How should I determine direction from a phone's orientation & accelerometer?

I have an Android application which moves a ball based on the orientation of the phone. I've been using the following code to extract the data - but how do I use it to determine what direction the ...
0
votes
2answers
4k views

Android Java rectangle collision detection not working

I had been hard coding a collision detection system which was buggy. Then I came across using rectangles for collsion detection. So I put it all in and it does not work, I put a log in and it never ...
3
votes
4answers
4k 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 ...
1
vote
1answer
580 views

Box2D how to implement a camera?

By now i have this Camera class. package GameObjects; import main.Main; import org.jbox2d.common.Vec2; public class Camera { public int x; public int y; public int sx; public int sy; public ...
1
vote
1answer
686 views

Box2D platformer movement. Should i mess with velocity?

I have a platformer game in which I implemented the movement using a wheel attached to the hero. For jumping I use this: player.body.applyLinearImpulse(new Vec2(0, 30000000), ...
3
votes
1answer
2k views

Open GL Android frame-by-frame animation tutorial/example code

My first question was asked wrong, so I need to ask again :) I found out, that I will have to do an OpenGL animation for my Android game. The closest (known) example is Talking Tom (but I don't know ...
1
vote
0answers
261 views

When attaching AI to a vehicle should I define all steps or try Line of Sight?

This problem is related to an intersection simulation I am building for university. I will try to make it as general as possible. I am trying to assign AI to a vehicle using the JMonkeyEngine ...
3
votes
1answer
1k views

How do I implement smooth movement in a Box2D platform game?

I have implemented a character in JBox2D which moves with the help of a wheel rotating at the bottom of it. The movement is the best result I've had 'till now but it's a little glitchy when the ...
3
votes
1answer
438 views

Storing game objects with generic object information

In a simple game object class, you might have something like this: public abstract class GameObject { protected String name; // other properties protected double x, y; public ...
2
votes
2answers
1k views

Android/Java AI agent framework/middleware [closed]

I am looking for an AI agent framework to use as a starting point in an Android game I have to create for a university research project. It has been suggested to me to use JADE, but, as far as I can ...
4
votes
4answers
1k views

More efficient in range checking

I am going to use a specific example in my question, but overall it is pretty general. I use java and libgdx. I have a ship that moves through space. In space there is debris that the ship can ...
4
votes
1answer
2k views

Box2D platformer movement. Are joints a good idea?

So i smashed my brains trying to make my character move. As i wanted later in the game to add explosions and bullets it wasn't a good idea to mess with the velocity and the forces/impulses didn't work ...
1
vote
1answer
1k views

JBox2D applyLinearImpulse doesn't work

So i have this line of code: if(input.isKeyDown(Input.KEY_W)&&canJump()) { body.applyLinearImpulse(new Vec2(0, 30), cam.screenToWorld(body.getPosition())); ...
-1
votes
1answer
378 views

When should one use the Abstract, Implements, or extends keywords? [closed]

I'm just now moving from a beginner to intermediate level android programmer in the java language. i can successfully write a game framework of classes that work together to accomplish a task beyond ...
3
votes
2answers
708 views

Slick & NiftyGUI. Nifty initialize exception

I found my self into trouble when trying to run a Slick game with a Nifty Game State. This is the code: @Override protected void initGameAndGUI(GameContainer container, StateBasedGame game) ...
1
vote
1answer
2k views

Android frame by frame PNG animation

I am new at Android game development. I have done some apps before, but none of them are games :) So, I wanted to do a frame-by-frame animation of PNGs. I tried with AnimationDrawable, but ...
2
votes
1answer
2k views

Using Nifty GUI with Slick2D

As seen here NiftyGUI has it's own GameState classes, I want to know if for adding UI to one state of my game I need to make that state NiftyOverlayGameState or still a BasicGameState but to add a ...
-4
votes
2answers
950 views

How to create Executable Jar [closed]

When I run a jar file I created, I get the following error, so please someone help me out of this: Exception in thread "LWJGL Application" com.badlogic.gdx.utils.GdxRuntimeException: Couldn't ...
2
votes
1answer
1k views

Rending 2D Tile World (With Player In The Middle)

What I have at the moment is a series of data structures I'm using, and I would like to render the world onto the screen (just the visible parts). I've actually already done this several times (lots ...
3
votes
1answer
558 views

Photon alongside LibGDX

Can anyone point me to a possible implementation of the Photon network engine along with LibGDX for Android? Or any multiplayer networking SDK for all that matters. From reading source code it ...
0
votes
0answers
58 views

OpenGL 2D Depth Perception [duplicate]

Possible Duplicate: OpenGL 2D Depth Perception I have a 2D RPG game written in Java using LWJGL. All works fine, but at the moment I'm having trouble deciding what the best way to do depth ...
0
votes
4answers
917 views

OpenGL 2D Depth Perception

I have a 2D RPG game written in Java using LWJGL. All works fine, but at the moment I'm having trouble deciding what the best way to do depth perception is. So , for example, if the player goes in ...
0
votes
1answer
335 views

Calculating an orbit and approach velocties

I have drones in my game that need to approach and orbit a node and shoot at it. Problem is I want to stay away from a real physics simulation, meaning I don't want to give the node and drone a mass ...
2
votes
2answers
1k views

What is the most efficient way to add and remove Slick2D sprites?

I'm making a game in Java with Slick2D and I want to create planes which shoots: int maxBullets = 40; static int bullet = 0; Missile missile[] = new Missile[maxBullets]; I want to create/move my ...
2
votes
2answers
2k views

Floodfill algorithm for GO

The floodfill algorithm is used in the bucket tool in MS paint and photoshop, but it can also be used for GO and minesweeper. http://en.wikipedia.org/wiki/Flood_fill In go you can capture groups of ...
10
votes
5answers
9k views

How do I shuffle cards for a card game?

I am trying to develop an card game for Android Can anyone suggest me how to write code for effectively shuffling the playing cards?
0
votes
1answer
584 views

Android Loading Screen: How do I use a stack to load elements?

I have some problems with figuring out what value I should put in the function: int value_needed_to_figure_out = X; ProgressBar.incrementProgressBy(value_needed_to_figure_out); I've been ...
0
votes
2answers
504 views

Can J2EE be used to implement games ? Is there any connection between J2EE and games?

Making an game using applets, but have to implement project using J2EE. Is there any sense in making a game with using J2EE for implementation ? Our teacher said that we can make games for the java ...
1
vote
4answers
3k views

What Java class should I use to represent a Vector?

Does Java have a built-in Vector class suitable for handling collision detection / response? It should have methods like subtract(Vector v), normalize(), dotProduct(Vector v), ... It seems logical to ...