Preface: I’m very new to objective-c and I am doing simple exercises to learn in order to progress as a developer.
- Let’s say we’re playing a memory game. You start with two images: a
cow and a pig. - A word is shown (cow or pig) and you click a corresponding button.
My problem: How do I progress the user to four cards the six and so-on? Quasi-levels of a game, I guess…or more simply.
Second question: If it were simply one static set of cards (four), how do I allow time between the success message and a reset of the board?
I’m asking more hypothetically, but exact answers would be helpful too so I can understand more about syntax.
If this is confusing, I’m sorry. 🙂 Any information is welcomed!
How do I progress the user to four cards the six and so-on?“Sequence” == “State”
State is usually maintained with instance variables… so, how about a
numberOfCardsvariable? And maybe anumberOfGamesPlayedvariable as a factor in deciding when to increase the number of cards?If it were simply one static set of cards (four), how do I allow time between the success message and a reset of the board?Tons of options… two decent ones are:
NSTimerperformSelector:withObject:afterDelay: