HACK110 Memory Game Project

Created by Eric Shyu and Juliana Evans.

For hack110 we decided to create a single player memory game. There is a grid composed of a 4x8 set of tiles with each tile containing a letter that can be matched with the letter in another tile. The tiles will remain visible for 15 seconds then disappear. There is a turn counter, and after you sucessfully match all the tiles the game will rate how you did.

General Concepts Used

One of the biggest part of this project was using features from javafx. We imported labels and shapes from javafx. We made use of the EventHandler interface for buttons as well as mouse events. A method called fadeTransition was used to make the letters disappear and reappear. We used a list to assign letters to each tile. Randomization is used to shuffle the tiles. There were 3 counters used. Booleans and else if statements were used in determining how well a player did. We created mulitple classes. We also created helper methods. For loops were used quite a bit as well.

Challenges/New Concepts

One of the biggest challenges was figuring out how to start. At first we had planned to use 2d arrays for the tiles, but after some testing and research we changed our approach to creating multiple tile objects from our Tile class and setting their position with a for loop and formula. We learned so many things about javafx and since we did not use scenebuilder we learned how to place objects with code as well as linking mouse clicks and buttons with code.

The biggest challenge we had was creating the restart button. It took us a while to figure out to make the button work. After that trying to make the game reset took a long time. We were able to create a new board, but the old one did not reset. Since the tiles were transparent the old and new letters overlapped making it impoosible to read. Since the letters and tiles were in different classes we could not figure out how to make them both disappear. Eventually we just made the tiles non transparent by adding a rectagle right before a new board was generated and it fixed the problem. There are still a few bugs we did not have time to work out.

Individual Contributions

Most of it was collaborative work and research.

Eric: checks for the tile pairing, counters and labels, randomizing letters

Julliana: had the idea for the project, started project, helper methods

Goals Achieved

We wanted to make something that we might actually be able to use. Eventhough this game is not that useful, it can still be played alone when you are waiting for class to start. We also learned a lot which was the main goal.

Future Goals

Make cooler games or something with more practical use.