Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@jasonmcdermott
Last active August 29, 2015 14:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jasonmcdermott/78770c55af4220b23d04 to your computer and use it in GitHub Desktop.
Save jasonmcdermott/78770c55af4220b23d04 to your computer and use it in GitHub Desktop.
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