iDevGames Forums
Need help in the memory game - Printable Version

+- iDevGames Forums (http://www.idevgames.com/forums)
+-- Forum: Development Zone (/forum-3.html)
+--- Forum: iPhone, iPad & iPod Game Development (/forum-11.html)
+--- Thread: Need help in the memory game (/thread-8501.html)



Need help in the memory game - soulesstps - Jan 4, 2011 09:35 PM

Hi all, can anyone guide me on how to stop a method when it is being called by using: [self performerSelector: withObject: afterDelay:];

as my selector method is doing: button.highlighed = !button.highlighted;
it seems to be repeating itself and "blinks" together with other buttons.
Thanks for any help or advice. =)


RE: Need help in the memory game - OneSadCookie - Jan 4, 2011 11:00 PM

If you don't want it to happen more than once, don't tell it to happen more than once?


RE: Need help in the memory game - soulesstps - Jan 5, 2011 01:21 AM

haha.. I know.. but I do not know how to ask him not to repeat. lol


RE: Need help in the memory game - OneSadCookie - Jan 5, 2011 01:31 AM

It doesn't repeat. Just don't do it more than once.


RE: Need help in the memory game - soulesstps - Jan 5, 2011 01:55 AM

but my current code doesn't make it perform more than once.


if (d == one){
[self performSelector:@selector(delayEventRED) withObject:red afterDelay:1.0f];

[self performSelector:@selector(delayEventGREEN) withObject:green afterDelay:3.0f];

[self performSelector:@selector(delayEventYELLOW) withObject:yellow afterDelay:5.0f];

[self performSelector:@selector(delayEventBLUE) withObject:blue afterDelay:7.0f];

}

currently is like that.


RE: Need help in the memory game - OneSadCookie - Jan 5, 2011 08:31 AM

I find it odd that you are passing arguments to selectors which don't take arguments, but that's beside the point.

perhaps the method that contains this code is called more than once.


RE: Need help in the memory game - soulesstps - Jan 5, 2011 06:55 PM

the code behind the method is only:

red.highlighted = !red.highlighted;


and so on.


RE: Need help in the memory game - soulesstps - Jan 6, 2011 09:10 PM

thx alot. I got what I want already =)