Results 1 to 4 of 4
- 01-03-2009, 09:14 AM #1
Member
- Join Date
- Jan 2009
- Posts
- 26
- Rep Power
- 0
[SOLVED] Ready to Program Java IDE Problem #3 PacMan For Loop to Slide Across the Scr
Hi,
Here is my assignment:
Modify your pacman program. Complete the methods to draw a closed mouth. Use a for loop to slide pacman across the screen.
Here is what I have done:
// The "PacManModified" class.
import java.awt.*;
import hsa.Console;
public class PacManModified
{
static Console c; // The output console
public static void main (String[] args)
{
c = new Console ();
for (int i=0; i< 10; i++)
{
closedMouth (50,50,50);
openMouth (50,50,50);
}
} // main method
public static void closedMouth (int x, int y, int RADIUS)
{
c.setColor (Color.pink);
c.fillOval (x + 20, y + 8 , 30, 35);
}
public static void openMouth (int x, int y, int RADIUS)
{
c.setColor (Color.yellow);
c.fillArc (x, y, RADIUS, RADIUS, 30, 300);
c.setColor (Color.black);
c.fillOval (x + 20, y + 10, 8, 8);
}
public static void move ()
{
for ()
{
}
}
} // PacManModified class
I believe I have completed the method to draw the closed mouth. However, I do not understand how to use a for loop to slide PacMan across the screen.
Please help.
Thanks.
- 01-03-2009, 06:35 PM #2
Member
- Join Date
- Jan 2009
- Posts
- 26
- Rep Power
- 0
I still need help with this for loop to slide PacMan across the screen. Please help me...
Thanks.
- 01-04-2009, 10:28 PM #3
Member
- Join Date
- Jan 2009
- Posts
- 26
- Rep Power
- 0
Anyone please?
- 07-18-2009, 02:26 PM #4
Member
- Join Date
- Jul 2009
- Posts
- 3
- Rep Power
- 0
Similar Threads
-
a problem about java mail client program
By lunarstyle in forum AWT / SwingReplies: 9Last Post: 12-19-2009, 05:14 PM -
[SOLVED] Ready to Program Java IDE
By Starr29 in forum New To JavaReplies: 9Last Post: 07-24-2009, 06:21 PM -
[SOLVED] Ready to Program Java IDE Problem #2
By Starr29 in forum New To JavaReplies: 2Last Post: 01-03-2009, 02:02 AM -
Java Pacman question
By whdbstjr90 in forum New To JavaReplies: 0Last Post: 12-12-2007, 12:28 AM -
getting problem in compiling java program?
By sathish04021984 in forum New To JavaReplies: 3Last Post: 07-30-2007, 10:26 AM
Bookmarks