Commit f78f21fa authored by Melissa Tjong's avatar Melissa Tjong
Browse files

Choose Character Screen

parent f3509bb1
......@@ -47,10 +47,6 @@ public class Player extends Entity {
public Player(int character) {
this.character = character;
// sprite = true;
// this.spriteSheet = s;
// risingImage = rise;
// fallingImage = fall;
init();
}
......
......@@ -101,16 +101,20 @@ public class ChooseCharacter extends BasicGameState {
}
if (input.isMousePressed(0)) {
//Back Button
if ((posX > backX && posX < (backX + backWidth)) && (posY > backY && posY < (backY + backHeight))) {
game.getState(Main.MAINMENU).init(container, game);
game.enterState(Main.MAINMENU);
}
//Xeon
if ((posX > xeonX && posX < (xeonX + xeonWidth)) && (posY > xeonY && posY < (xeonY + xeonHeight))) {
game.getState(Main.MAINMENU).init(container, game);
MainMenu.chosenPlayer = 0;
game.enterState(Main.MAINMENU);
}
//MegaMan
if ((posX > megaManX && posX < (megaManX + megaManWidth)) && (posY > megaManY && posY < (megaManY + megaManHeight))) {
game.getState(Main.MAINMENU).init(container, game);
MainMenu.chosenPlayer = 1;
......
......@@ -154,16 +154,19 @@ public class MainMenu extends BasicGameState {
}
if (input.isMousePressed(0)) {
//Play button
if ((posX > playX && posX < (playX + playWidth)) && (posY > playY && posY < (playY + playHeight))) {
game.getState(Main.LVL1).init(container, game);
game.enterState(Main.LVL1);
}
//Choose character button
if ((posX > chooseX && posX < (chooseX + chooseWidth)) && (posY > chooseY && posY < (chooseY + chooseHeight))) {
game.getState(Main.CHOOSECHAR).init(container, game);
game.enterState(Main.CHOOSECHAR);
}
//Exit button
if ((posX > exitX && posX < (exitX + exitWidth)) && (posY > exitY && posY < (exitY + exitHeight))) {
System.exit(0);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment