I assume you need help in getting those coordinates???
If so, then it should be fairly simple. If the object is moving across the screen, then obviously you are doing something to change it's coordinates. Just get the values that are changing. If you provide more information I can help you more.
server_crash
Postaholic
2,111 posts since Jun 2004
Reputation Points: 113
Solved Threads: 20
I wouldn't worry about outputing to a file. That could big a consuming operation as you may be continiously writting to/from a file. Use an ArrayList. You don't have to have a definite size.
server_crash
Postaholic
2,111 posts since Jun 2004
Reputation Points: 113
Solved Threads: 20
Writing to a file is pretty simple with Java. Here's some sample code:
import java.io.*;
public class DoSomeFileOutput {[INDENT]public static void main (String[] args) {[INDENT]try {[INDENT]FileWriter fw = new FileWriter("myfile.txt");
PrintWriter pw = new PrintWriter(fw);
pw.println("Hello World!");
pw.close();[/INDENT]}
catch (IOException ioe) {[INDENT]ioe.printStackTrace();[/INDENT]}[/INDENT]}[/INDENT]}
What basically happens is that I wrapped a PrintWriter around the FileWriter . The PrintWriter provides the necessary services for String 's to be directly printed into a file. Don't forget to close the outmost stream wrapper after use!
AstroNox
Junior Poster in Training
50 posts since Mar 2006
Reputation Points: 10
Solved Threads: 2