Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
CSE2102_group_37/src/main/MouseInput.java
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
58 lines (43 sloc)
1.18 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main; | |
import java.awt.event.MouseEvent; | |
import java.awt.event.MouseListener; | |
public class MouseInput implements MouseListener{ | |
public void mouseClicked(MouseEvent arg0) { | |
// TODO Auto-generated method stub | |
} | |
public void mouseEntered(MouseEvent arg0) { | |
// TODO Auto-generated method stub | |
} | |
public void mouseExited(MouseEvent arg0) { | |
// TODO Auto-generated method stub | |
} | |
public void mousePressed(MouseEvent e) { | |
int mx = e.getX(); | |
int my = e.getY(); | |
if(mx >= 265 && mx <= 535 && my >= 225 && my <= 275) | |
{ | |
Game.numberOfPlayers = 1; | |
Game.padraicmode = false; | |
Game.State = Game.STATE.GAME; | |
} | |
else if(mx >= 285 && mx <= 515 && my >= 325 && my <= 375) | |
{ | |
Game.numberOfPlayers = 2; | |
Game.padraicmode = false; | |
Game.State = Game.STATE.GAME; | |
} | |
else if(mx >= 365 && mx <= 435 && my >= 425 && my <= 475) | |
{ | |
System.exit(1); | |
} | |
else if(mx >= 610 && mx <= 650 && my >= 540 && my <= 580) | |
{ | |
Game.numberOfPlayers = 1; | |
Game.padraicmode = true; | |
Game.State = Game.STATE.GAME; | |
} | |
} | |
public void mouseReleased(MouseEvent arg0) { | |
// TODO Auto-generated method stub | |
} | |
} |