Sagewire Logo

2d graphics and 2 other questions

2 Message(s) by 2 Author(s) originally posted in java help


From: blah bah7 Date:   Thursday, October 18, 2007
1. how do you make 2d graphics like the old 70's pac man (better than
that...)
2. how do you make it so a computer runs until a key is pressed where
it then preforms an operation and then picks up where you left off
when you pressed the key
3. how can I make a simple jframe to put the graphics in (i knew
this...)

thanks for the help


From: Matt Humphrey Date:   Friday, October 19, 2007
| 1. how do you make 2d graphics like the old 70's pac man (better than
| that...)

Look up the JAVA2D API. http://JAVA.sun.com/products/JAVA-media/2D/index.jsp

Essentially you create a data structure that represents the image and you
render that in the paint () method of your component.
http://JAVA.sun.com/products/jfc/tsc/articles/painting/

| 2. how do you make it so a computer runs until a key is pressed where
| it then preforms an operation and then picks up where you left off
| when you pressed the key

You do not. Make your game event driven by setting up a listener for
keypresses. Every time a key is pressed your code gets called.

| 3. how can I make a simple jframe to put the graphics in (i knew
| this...)

JFrame f = new JFrame ();
f.setSize (new Dimension (500, 400));
f.setVisible (true);

You will need a tutorial on Swing to get anywhere

http://JAVA.sun.com/docs/books/tutorial/uiswing/

Matt Humphrey http://www.iviz.com/



Next Message: Sending data from one class to another


Blogs related to 2d graphics and 2 other questions

Euler
Whereas some are tempted to give up when confronted with the question of how something will come to be, others are prone to go the opposite extreme On the other hand Standard & Poor's Ratings Services has raised its long-term ...

Pager SMS Component for Windows, to send and receive SMS messages ...
Pager Quick summary of the state of the art in SWT and Swing integration, including also options for Java 2D. Forgive me, but I want to add a rule to pagerise Facebook search results. I can't figure out how to add stuff to the Wiki. ...

c++ curriculum experience phd resume submit tip uk vitae
... program using c++ design download large scale software c++ design engineering java pattern round trip uml c++ design in mastering object oriented c++ design in mastering pattern c++ design interview questions c++ design introduction ...

Im currently running web a kernel compile using make-kpkg with ...
ok. i try with a clean kernel or write a bug-report the other question is about nscd it doesn’t seams to work right on hosts caching i tryed fedora glibc2.3.6 and debian etch fedora works, debian doesn’t ...

Family Feud Online Party
Our download game engine provided great 2D graphics and rich audio, and it tapped directly into video memory, the stack, the file system, the mouse and keyboard, and other pieces of the local operating system. We didn’t want to lose any ...

Java Programming Resources:
Hundreds of fully documented Java examples, including Swing, Java 2D, threads, events, XML, servlets, and JSP. Also lots of HTML 4, CSS, and JavaScript examples. JSP and Servlet Programming Resources ...


Programming | Sports | Autos

copyright 2006
Valid XHTML 1.0 Transitional