Monday, September 5, 2011

3rd Open Source Game - Memorise Me If You Can!!

As mentioned in previous post, I finally got the whole game working, and tested/approved by my 10 years old "iPhone game testing" specialist.

I decided to call it "Memorise Me If You Can !!" The game is based on ABC123 and it's so simple that it shouldn't require any further explanation. I have posted this short demo video on YouTube:


I have added quite a few features to make it more interesting and easy to play, I think any one can at least easily reach level 10.

I learned from playing the popular game "Tiny Tower" that when the score gets updated, by moving it down and then back quickly, it catches player's attention due to the movement. I quite like it so I also added this feature to the game.

Some of the things different (extra!) from ABC123 as below:

  1. handles rotation (portrait upside down)
  2. shows count-down before each level
  3. count-down time increased every 2 levels to make the game challenging but still achievable
  4. change background image every level to make it more interesting
    1.     Note:       There's this last minute change to this part of code (the 2nd internal if loop) which now changes it to change background image every level. Originally it was only to change at "every 2 levels". Can easily change it back by enabling the internal if loop.
                  //change background colour every 2nd level if not 1st start
                  if ((curGameData.prevGameState != -1)) {
                      
                      //if (isCurrentTurnNumberNotChar) {
                          self.view.backgroundColor = [self getNextBackgroundColor:kDontUseDefaultBackGroundImage];
                      //}
                  }
    2. display current level
    3. added visual effect to shake/move score/life/level value
    4. use faded effect for all display message to maintain clean interface
    5. added simple info about how to play at the bottom of the screen during count-down
    6. didn't add menus at beginning of game
    7. like the previous ball bouncing game, keeps track of top score


    A few screen dumps as below:

    I can also think of quite a few extra stuffs for future enhancements:

    1. Might need some more refactoring, as I didn't spend lots of time in planning the object/file separations. Lots of the codes in the view controller might be able to be further separated to make it cleaner
    2. May be a more challenging "reverse order" every 5 levels to make it more interesting?
    3. May be a menu at the beginning with a simple tutorial/how to play?
    4. currently timer set to 1 sec, may be can make it smaller to make it more responsive. As now everything has to wait for 1 sec before the timer kicks in next check. But this might make the count-down part more complicate.
    5. MUSIC and SOUND EFFECT! This is still my weakest point as I am still using the simulator. Hopefully can start testing on real device soon.


    Code structure wise, it's quite simple, other than main and AppDelegate, there's:

    1. UIViewController => for View Controller 
    2. BubbleObj => UIView class for all the bubbles. Yes it's not in round shape but I still call it bubble, the image is from previous "glass button generator" project 
    3. GameData => to hold game related data 
    4. ScoreLifeObj => to hold score, life, level data 
    5. SharedUtilities => for utilities that shows the count down, shakes the label, shows messages that fade away in a few seconds time, ...etc 


    Game control logic wise, still follows the same game looping method learned from ball bouncing game. Using 2 int variable to keep track of current and previous game state, then calls different methods accordingly. Top score tracking is done using application preference.

    I have also tested the game in "Instruments" and found no memory leaks.

    Hope you find the game interesting, let you know if you found any bug or got any questions.

    Source code of the "Memorise Me If You Can" Game project

    0 comments:

    Post a Comment