i ma working on game as assignment I've never really programmed a game before, wtih java programing language, so I'm completely new … ame across very little information on starting game development in java programming a … I'm looking to write a game with java code programe that also put the data to a file.can any one post me some java game source code or tell me how can i write the program .
Install a Java IDE (netbeans or eclipse), take a book on Java and study the tutorials. Eventually you'll learn how to write data to files. These are the basics you need to know before accepting such a starting with your assignment.
Basicly a game is nothing else then a main loop that performs (mostly) these steps:
- Handle user input
- Handle all game objects
- Draw the objects
Ofc, the games these days are very very large and difficult - but I guess you should not look at these.
If you don't know java very well you should first read some tutorial or similar.
Saving somethin to file is quite easy in java. But it depends on your needs what is useable for you. You could simple make your game objects serializable and then use an objectOutputStream, or just make a txt file with the information you need (with a filewriter).
I would check out the StdDraw library here: http://www.cs.princeton.edu/introcs/stdlib/
It's designed to accompany a Java textbook by Sedgewick & Wayne and provides a simple way to draw circles, rectangles, text, and so on, and to accept and handle user input. Obviously it's not as fast or general-purpose as Java2D, but depending on how complicated the assignment is, it may fit the bill.
If you are very familiar with Java and object-oriented progamming in general, you may want to just start learning Java2D: http://java.sun.com/docs/books/tutorial/2d/index.html