Results 1 to 2 of 2
  1. #1
    Slicknife is offline Member
    Join Date
    May 2012
    Posts
    1
    Rep Power
    0

    Question Ball moving across the screen?

    Well at school I am using an IDE called Ready to Program, which you probably haven't heard of. I have to make a ball move diagonally across the screen and so far I have this piece of code that apparently worked for some people but it doesn't for me. I think I missed something?




    Java Code:
    import java.awt.*;
    import hsa.Console;
    public class Template
    {
        static Console c = new Console ();
        public static void main (String args[])
        {
        
            int x=0, y=0;
            
            while(true)
            {
            c.setColor(Color.black);
            c.fillOval(x,y,30,30);
            for (int i =1; i <= 100; i++)
            
            
            c.setColor(Color.white);
            c.fillOval(x,y,30,30);
            
            }
        
        }
        
    }
    Apologies if this IDE is unfamiliar to you but any help is appreciated.

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,755
    Rep Power
    25

    Default Re: Ball moving across the screen?

    it doesn't for me
    Can you explain what "doesn't work" means?

    Since you are using a third party package (hsa) its hard for anyone here to compile and test the code.
    If you don't understand my response, don't ignore it, ask a question.

Similar Threads

  1. Moving a ball
    By jsmasand in forum Java 2D
    Replies: 5
    Last Post: 04-27-2012, 04:34 AM
  2. Moving a ball by dragging the mouse
    By stevo812 in forum Java Applets
    Replies: 5
    Last Post: 03-31-2012, 01:49 AM
  3. Ball not moving
    By Eleeist in forum New To Java
    Replies: 7
    Last Post: 01-05-2012, 12:27 AM
  4. Moving a ball with Arrow Keys
    By kekcklemen in forum Java Applets
    Replies: 5
    Last Post: 02-25-2011, 11:15 PM
  5. Moving Cars across the screen, help!
    By Keno777 in forum New To Java
    Replies: 5
    Last Post: 03-04-2010, 03:57 PM

Posting Permissions

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