
-----------------------------------
Token
Thu Mar 09, 2006 7:06 am

Help with mouse movement
-----------------------------------
Okay, I made a program and i'm having troubles getting the mouse listener to work, i looked around at the site but i still have had no success, its not for school so feel free to add or remove lines or whatever, if you want to see what i wrote before I changed the mouse thing read the commented instructions in the code. Thanks in advance.




// The "Bounce" class.
import java.awt.*;
import java.applet.Applet;
import hsa.Console;
import java.*;
                                                                            //in order to make it work as before comment:
public class Bounce implements MouseMotionListener // this line

{
    static Console c;           // The output console

    public static void main (String [] args) throws InterruptedException
    {
        new MotionListener m;           // this line
        addMouseMotionListener (m);// this line
        c = new Console (25, 90);
        int ballx, bally;
        ballx = m.getX ();
        bally = m.getX ();
        int [] x = new int [11];
        int [] y = new int [11];
        int [] xdir = new int [11];
        int [] ydir = new int [11];










        for (int i = 1 ; i  0 || x [i] = c.getHeight () - 5 && ydir [i] > 0 || y [i] 