Multiple Mouse Listeners. Need help!
Hey again people, i hope my questions aren't to tiring, and thank you originalsup3rman for answering my last question. I didn't want to revive the thread for fear of annoying some random person.
On to the question.
I was just wondering the best way to go about having a MouseListener and a MouseMotionListener to operate at the same time. What i'm doing is, i'm moving a guy with the mouse (he follows the mouses position) then i need him to be able to shoot at the SAME time with the clicker. Right now whenever i'm currently moving the mouse i can't shoot, but i can shoot when the mouse isn't moving. OK so this is the way i'm doing it right now:
Player p;
publicclass GameThing{
public GameThing(){
p =new Player...
addMouseMotionListener(new Listener());
addMouseListener(new Listener());
...
...
}
...
...
...
publicclass Listenerimplements MouseListener, MouseMotionListener{
publicvoid mouseClicked(MouseEvent e){
p.addBullet();
}
publicvoid mouseEntered(MouseEvent e){}
publicvoid mouseExited(MouseEvent e){}
publicvoid mousePressed(MouseEvent e){}
publicvoid mouseReleased(MouseEvent e){}
publicvoid mouseDragged(MouseEvent e){
p.synch(e.getX(), e.getY());
}
publicvoid mouseMoved(MouseEvent e){
p.synch(e.getX(), e.getY());
}
}
...
...
...
}
(keep in mind this isn't my entire class, i'm only showing the parts pertaining to the problem ;D)
I know someone can answer my question quickly and painlessly, I'd REALLY appreciate a response, thanks again for being so helpful.
p.s. I'm heading off to work now as well so if you have a question about my code i'll be back at 10:00. :D

