Skip to content

Commit

Permalink
Merge pull request #59 from hyeminyoo/master
Browse files Browse the repository at this point in the history
fixed issues #55, #44, #47, #57
  • Loading branch information
athielk authored Nov 13, 2016
2 parents 21252ea + 16e66da commit 946719b
Show file tree
Hide file tree
Showing 5 changed files with 108 additions and 35 deletions.
22 changes: 11 additions & 11 deletions F16_lab03.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
Dong He
Margaret Schmidt
Hyemin Yoo (Minnie)

1. Card matching game, click the cards to reveal them and click two of the same to permanently reveal them.
2. As a player I can click cards so that they reveal their icon. As a player I can click two matching cards to permanently reveal them. As a player I can play the game and save my highscore. As a player I can click instructions and be given a instruction screen of how to play the game.
3. The software runs except for a few brief freezes. It generates a board of x * x amount of cards and waits for you to click.
4. As a player I should be able to access the highscores and instructions without being spammed with pop-ups. As a player I should be able to finish a level and see some sort of progression animation so I know when I have finished a level.
5. The basic information is present, there is nothing detailed or project history. Notes present on not recommending this project for future students as it is well built and almost done.
6. As far as we can tell nothing needs to be updated. It builds properly and there are no noticeable issues. Nothing old to remove either.
7. https://github.com/UCSB-CS56-Projects/cs56-games-memory-card/issues/51 , https://github.com/UCSB-CS56-Projects/cs56-games-memory-card/issues/52 , https://github.com/UCSB-CS56-Projects/cs56-games-memory-card/issues/53
8. The code is divided into multiple java files, each one accomplishes a task given by the name of the file. Within each file, there are comments present on each method, contructor, and variable to tell the reader what the thing does. Honestly, for any future workers on this project, you can easily digest what everything does in this project. Only thing lacking in the comments is HighScoreBoard.java. Nothing to really fault the old programmers on.
9. There are a decent chunk of tests, cover a lot of common things and the most used methods and constructors. Could have added more and future workers on this project can add more JUnit test cases if desired. If future test cases were to be added, I would expand the situations the tests cover and make sure every method is tested.
1. Memory Card Game is a game that flips two cards each time to find matching pairs before time runs out.
2. As a player I can click start/resume to start the game and to get the timer going/starting. As a player I can click a card to flip it and see which picture it has. As a player I can click two matching cards to earn score and to permanently flip the card until that round is over.
3. The software runs except there are glitches here and there. It starts the game with x by x number of cards.
4. As a player it might be more fun to play with more difficulties. As a player I could see some animation after I finish a level.
5. The README.md tells you a brief description about the game, and that this project is well-built in terms of logic and design. It would be better if README.md has details about how many cards the player starts with and how to flip cards. Also, screenshots of the cards might be useful and more descriptive.
6. The build.xml file does not have any targets that need descriptions, or old legacy JWS stuff that needs to be removed.
7. There are enough issues to earn 1000 points by working on this project. The expectations to how the issues should be fixed are clear.
8. There are no issues added because this is a switched repo.
9. The code is in different files with names that straight-forwardly tell what each file does. The purposes of classes and the methods are clear and the code structure is well-built. There are issues here and there but overall, the code is pretty easy to comprehend. There are different files for making grid, using grid, using GUI, instruction screen, exceptions, etc..
10. There are tests, but they do not cover every possible situations. They cover constructors, methods, and different random cases. There can be more JUnit tests.
Binary file modified dist/cs56_13S_memorycard.jar
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
package edu.ucsb.cs56.projects.games.memorycard;
import java.awt.Component;
import java.io.*;
import java.awt.Font;
import javax.swing.JTextArea;
Expand All @@ -13,6 +14,8 @@ public HighScoreBoard(){
}
private void getHighScores(){
File file = new File("highscores.txt");
// revalidate();
// repaint();
try{
BufferedReader b = new BufferedReader(
new InputStreamReader(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
@author Ryan Halbrook and Yun Suk Chang
@author Mathew Glodack, Christina Morris
@author Xiaohe He, Shaoyi Zhang
@version CS56 Spring 2016
@author Hyemin Yoo
@version CS56 Fall 2016
@see MemoryGrid
*/
public class MemoryGameComponent extends JComponent implements ActionListener
Expand Down Expand Up @@ -179,8 +180,9 @@ public void stopMusic(){
time and start the timer.
*/
public void pauseB() {
pauseStart = new Date().getTime();
timer.stop();
pauseStart = new Date().getTime();
//timer.stop();
JOptionPane popup = new JOptionPane("PAUSED");
Object[] options = {"Resume"};

Expand Down Expand Up @@ -640,7 +642,7 @@ public void storeHighScore(){
Object[] options2 = {"Yes","No"};
int selection2 = popup2.showOptionDialog(
null,
"You have recieved a high score!\nScore: "+score+"\nWould you like to save the score?",
"You have received a high score!\nScore: "+score+"\nWould you like to save the score?",
"Congratulation!",
JOptionPane.YES_NO_OPTION,
JOptionPane.INFORMATION_MESSAGE, null,
Expand Down
110 changes: 89 additions & 21 deletions src/edu/ucsb/cs56/projects/games/memorycard/MemoryGameGui.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@
import javax.swing.*;
import java.awt.ComponentOrientation;
import java.io.*;
import javax.swing.text.DefaultCaret;
/**
*
* @author Bryce McGaw and Jonathan Yau
* @author Ryan Halbrook and Yun Suk Chang
* @author Mathew Glodack, Christina Morris
* @author Xiaohe He, Shaoyi Zhang
* @version CS56 Winter 2016
* @author Hyemin Yoo
* @version CS56 Fall 2016
* Edited Professor Phill Conrad's code from Lab06
*/
public class MemoryGameGui {
Expand All @@ -45,29 +47,93 @@ public class MemoryGameGui {
static Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
static ActionListener highscoreListener = new ActionListener(){
public void actionPerformed(ActionEvent e){
JFrame scoreboard = new JFrame("High Score Board");
scoreboard.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
JTextArea txt = board.getBoard();
txt.setLineWrap(true);
txt.setEditable(false);
JScrollPane scroller2 = new JScrollPane(txt);
scroller2.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
scroller2.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
scoreboard.add(scroller2);

scoreboard.getContentPane().add(txt);
scoreboard.setSize(350,350);
Dimension screenSize2 = Toolkit.getDefaultToolkit().getScreenSize();
scoreboard.setLocation((int)(screenSize2.getWidth()/2 - scoreboard.getSize().getWidth()/2), (int)(screenSize2.getHeight()/2 - scoreboard.getSize().getHeight()/2));
scoreboard.setVisible(true);

}
};
static ActionListener instructionListener = new ActionListener(){

//clear up the frame
frame.getContentPane().removeAll();
frame.getContentPane().revalidate();
frame.getContentPane().repaint();
//go();
//}

frame.setLocation((int)(screenSize.getWidth()/2 - frame.getSize().getWidth()/2), (int)(screenSize.getHeight()/2 - frame.getSize().getHeight()/2));
frame.setSize(WINDOW_SIZE, WINDOW_SIZE);
frame.setPreferredSize(new Dimension(WINDOW_SIZE, WINDOW_SIZE));
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);


//JTextArea textArea;
JPanel upperPanel = new JPanel();


//textField = new JTextField(20);
//textArea = new JTextArea(25, 45);

JTextArea textArea = board.getBoard();
//textArea.setColumns(20);
//textArea.setRows(25);
//textArea.setLineWrap(true);
//textArea.setEditable(false);


upperPanel.setBackground(Color.gray);
//lowerPanel.setBackground(Color.pink);
textArea.setEditable(false);

//frame.add(upperPanel);//, "North");
frame.add(textArea);

//f.getContentPane().add(lowerPanel, "South");
//upperPanel.add(textArea);
//lowerPanel.add(textField);

frame.pack();
frame.setVisible(true);

//textArea.append("This is Test"+"\n");
//textArea.append(textArea);
//textField.requestFocus();
//textField.addActionListener(this);

ActionListener menuListener = new ActionListener(){
public void actionPerformed(ActionEvent e){
menu();
}
};

// register events with the buttons

menu.addActionListener(menuListener);

//JPanel sp2 = new JPanel(new BorderLayout());
//sp2.add(menu);
//upperPanel.add(BorderLayout.EAST,menu);
frame.add(BorderLayout.NORTH,menu);

//frame.getContentPane().add(BorderLayout.NORTH,upperPanel);
//frame.add(upperPanel);

// to make sure that grids go left to right
frame.applyComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
//frame.setSize(WINDOW_SIZE, WINDOW_SIZE);

frame.setVisible(true);


//frame.setVisible(true);


}
};

static ActionListener instructionListener = new ActionListener(){
public void actionPerformed(ActionEvent e) {
JPanel panel = new JPanel();
text.setLineWrap(true);
text.setEditable(false);

DefaultCaret caret=(DefaultCaret)text.getCaret();
caret.setUpdatePolicy(DefaultCaret.NEVER_UPDATE);

JScrollPane scroller = new JScrollPane(text);
scroller.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
scroller.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
Expand All @@ -81,6 +147,8 @@ public void actionPerformed(ActionEvent e) {
}
};



// the menu page
public static void menu() {
ActionListener startListener = new ActionListener(){
Expand Down Expand Up @@ -132,7 +200,7 @@ public void actionPerformed(ActionEvent e) {

public static void main (String[] args) {

frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
instruction.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
frame.setSize(WINDOW_SIZE, WINDOW_SIZE);

Expand Down

0 comments on commit 946719b

Please sign in to comment.