About movement in 2D system
I have a question about dealing with multiple threads moving in a 2D system.
If I've got several threads in my program. Each thread represents one character which can move everywhere in my game. What is the best way to keep track of their position and to check if two of them encounter each other?
It's generally a bad idea to create separate threads for every character of your game. A common way is to have an update-method in your base game object class, and call the method once per every game tick. Best way to keep track of their position is to do it inside your game object (or character) class - so every object will have it's own x,y position. To check for encounterings, you could simply have a list containing all the characters and loop through it once per every game tick and check collision for each object against every other object. You can do the collision detection easily with the shape-classes of Java2D.