Skip to content

Instantly share code, notes, and snippets.

@jasonmcdermott

jasonmcdermott/showButton

Last active Aug 29, 2015
Embed
What would you like to do?
showButton & makeRect
- (void)showButton {
if (playing) {
int buttonSelection = arc4random() % 3;
if (buttonSelection == 1) {
self.hitMeButton.frame = [self makeFrameForButton:self.hitMeButton];
self.hitMeButton.hidden = FALSE;
} else if (buttonSelection == 0) {
self.loseLifeButton.frame = [self makeFrameForButton:self.loseLifeButton];
self.loseLifeButton.hidden = FALSE;
} else if (buttonSelection == 2) {
self.addTimeButton.frame = [self makeFrameForButton:self.addTimeButton];
self.addTimeButton.hidden = FALSE;
}
[NSTimer scheduledTimerWithTimeInterval:1.0
target:self
selector:@selector(hideButton)
userInfo:nil
repeats:NO];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.