@hazlin For some reason this project wasn’t as confusing for me and I got it done in a relatively shorter amount of time, I guess it’s becauese things are not moving all across the screen? Anyways, this is a simple memory-matching game. Test the original game for yourself here. For my version, I’ve added a hover animation (where your mouse moves to, a tile will change color) and a restart button.
Note to self: To change a cosmetic or to create visual objects, put it in the draw = function()
By the way, my restart button basically does the same thing as the restart button outside of the game box. I added it because if you think about it, a real game would need one inside of it. While setting them back to tile.isFaceUp to false is easy, it’s not a true reset because the actual cards don’t change. So it’s kind of cheating!
So for that, we’d need to make it truly reset for a fair start-over. We’ve come over some weird bugs trying to implement that, like the program would crash and the tiles would move out of their line. But eventually that was fixed by using the same code from the randomizer portion. Basically, a reset is when all the cards turn face down again and is randomized, that’s how it’s done here.
076萌SNS is a social network, courtesy of 076. It runs on GNU social, version 2.0.2-beta0, available under the GNU Affero General Public License.
All 076萌SNS content and data are available under the Creative Commons Attribution 3.0 license.