Skip to content

Commit

Permalink
Exeplore v1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
srbcheema1 committed Mar 27, 2017
1 parent 6efec40 commit 9c3b28c
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 24 deletions.
Binary file modified dist/ExeploreGame.jar
Binary file not shown.
37 changes: 25 additions & 12 deletions src/exeploreGame/GamePannel.java
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public void updateGui(){

public void openGame(int index){
switch(index){
case 1:
case 1://tic tac toe
cardPannel=1;
if(gamePannel1.bestScore<30){
card.show(controlPannel,"gamePannel1");
Expand All @@ -103,7 +103,7 @@ public void openGame(int index){
JOptionPane.showMessageDialog(controlPannel, "Game is completed");
}
break;
case 2:
case 2://memory
cardPannel=2;
if(gamePannel2.bestScore<45){
card.show(controlPannel,"gamePannel2");
Expand All @@ -114,7 +114,7 @@ public void openGame(int index){
JOptionPane.showMessageDialog(controlPannel, "Game is completed");
}
break;
case 3:
case 3://queen8
cardPannel=3;
if(gamePannel3.bestScore<40){
card.show(controlPannel,"gamePannel3");
Expand All @@ -123,24 +123,37 @@ public void openGame(int index){
JOptionPane.showMessageDialog(controlPannel, "Game is completed");
}
break;
case 4:
case 4://black vs white
cardPannel=4;
card.show(controlPannel,"gamePannel4");
gamePannel4.getFocus();
if(gamePannel4.bestScore<48){
card.show(controlPannel,"gamePannel4");
gamePannel4.getFocus();
}
else{
JOptionPane.showMessageDialog(controlPannel, "Game is completed");
}
break;
case 5:
case 5://pic 4x4
cardPannel=5;
card.show(controlPannel,"gamePannel5");
gamePannel5.getFocus();
if(gamePannel5.bestScore<150){
card.show(controlPannel,"gamePannel5");
gamePannel5.getFocus();
}
else{
JOptionPane.showMessageDialog(controlPannel, "Game is completed");
}
break;
case 6:
case 6://snake
cardPannel=6;
if(gamePannel6.score<150){
if(gamePannel6.score<5000){
card.show(controlPannel,"gamePannel6");
gamePannel6.getFocus();
}
else{
JOptionPane.showMessageDialog(controlPannel, "Game is completed");
}
break;
case 7:
case 7://
cardPannel=7;
if(gamePannel7.score<60){
card.show(controlPannel,"gamePannel7");
Expand Down
6 changes: 0 additions & 6 deletions src/exeploreGame/GamePannel1.java
Original file line number Diff line number Diff line change
Expand Up @@ -304,8 +304,6 @@ else if(you_win-comp_wins>=3&&bestScore==20){
gamePannel.scoreUpdate();
JOptionPane.showMessageDialog(dialog, "you win");
gamePannel.home();
// setVisible(false); //you can't see me!
// dispose(); //Destroy the JFrame object
}
else{
JOptionPane.showMessageDialog(dialog, "you win");
Expand All @@ -315,10 +313,6 @@ else if(you_win-comp_wins>=3&&bestScore==20){
else{
JOptionPane.showMessageDialog(dialog, "BOT wins");
comp_wins++;
/* if(you_win-comp_wins==1)score=10;
if(you_win-comp_wins==2)score=20;
if(you_win-comp_wins<=0)score=0;
if(you_win-comp_wins==3)score=30; */
}
jLabel4.setText("YOU : "+you_win+"");
jLabel2.setText("COMP : "+comp_wins+"");
Expand Down
8 changes: 5 additions & 3 deletions src/exeploreGame/GamePannel2.java
Original file line number Diff line number Diff line change
Expand Up @@ -71,16 +71,18 @@ public void gameFinish(){
}
if(levelwin==1){
if(level<maxlevel){
scoreLabel.setText("score : "+bestScore);
gamePannel.scoreUpdate();
level++;
maxpics+=2;
pictime-=100;
initBoard();

scoreLabel.setText("score : "+bestScore);
gamePannel.scoreUpdate();
JOptionPane.showMessageDialog(controlPannel,"Move to next level","Level Complete",JOptionPane.INFORMATION_MESSAGE);
initBoard();
}
else if(level==maxlevel){
win=1;

scoreLabel.setText("score : "+bestScore);
gamePannel.scoreUpdate();
JOptionPane.showMessageDialog(controlPannel,"Yippee you won the game","Game Complete",JOptionPane.INFORMATION_MESSAGE);
Expand Down
3 changes: 1 addition & 2 deletions src/exeploreGame/GamePannel4.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import javax.swing.JButton;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.SwingWorker;
import javax.swing.Timer;
import javax.swing.border.Border;
import javax.swing.border.LineBorder;
Expand Down Expand Up @@ -166,7 +165,7 @@ public void wincheck(){
levelwin=1;
JOptionPane.showMessageDialog(controlPannel,"Hurrey you won"+"your score : "+moves+" ","Game Complete",JOptionPane.INFORMATION_MESSAGE);
}
if(a==1&&turn==-1){
if(a==1&&turn==-1){//mostly this will work
JOptionPane.showMessageDialog(controlPannel,"your score : "+moves+" ","Game Complete",JOptionPane.INFORMATION_MESSAGE);
}
}//checks if player or bot wins or not
Expand Down
2 changes: 1 addition & 1 deletion src/exeploreGame/GamePannel5.java
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ else if(level==maxlevel){
bestScoreLabel.setText("Best Score : "+String.format("%03d",bestScore));
gamePannel.scoreUpdate();
}
JOptionPane.showMessageDialog(controlPannel,"Your Score : "+movesLeft+" ","Game Complete",JOptionPane.INFORMATION_MESSAGE);
JOptionPane.showMessageDialog(controlPannel,"Your Score : "+bestScore+" ","Game Complete",JOptionPane.INFORMATION_MESSAGE);
}
}
return true;
Expand Down

0 comments on commit 9c3b28c

Please sign in to comment.