Results 1 to 4 of 4
  1. #1
    Starr29 is offline Member
    Join Date
    Jan 2009
    Posts
    26
    Rep Power
    0

    Default [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.

  2. #2
    Starr29 is offline Member
    Join Date
    Jan 2009
    Posts
    26
    Rep Power
    0

    Default

    I still need help with this for loop to slide PacMan across the screen. Please help me...
    Thanks.

  3. #3
    Starr29 is offline Member
    Join Date
    Jan 2009
    Posts
    26
    Rep Power
    0

    Default

    Anyone please?

  4. #4
    Kouichi is offline Member
    Join Date
    Jul 2009
    Posts
    3
    Rep Power
    0

    Default Hi

    Did anyone help you with the Pacman program? because funny thing, I have the same assignment and I need help to make the pacman move.

Similar Threads

  1. a problem about java mail client program
    By lunarstyle in forum AWT / Swing
    Replies: 9
    Last Post: 12-19-2009, 05:14 PM
  2. [SOLVED] Ready to Program Java IDE
    By Starr29 in forum New To Java
    Replies: 9
    Last Post: 07-24-2009, 06:21 PM
  3. [SOLVED] Ready to Program Java IDE Problem #2
    By Starr29 in forum New To Java
    Replies: 2
    Last Post: 01-03-2009, 02:02 AM
  4. Java Pacman question
    By whdbstjr90 in forum New To Java
    Replies: 0
    Last Post: 12-12-2007, 12:28 AM
  5. getting problem in compiling java program?
    By sathish04021984 in forum New To Java
    Replies: 3
    Last Post: 07-30-2007, 10:26 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •