This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Feel free to use. MIT License | |
| #import <Foundation/Foundation.h> | |
| #import "cocos2d.h" | |
| // Layer that will just capture any touch events on it | |
| @interface OpaqueLayer : CCLayerColor { | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #pragma mark - touch delegate | |
| - (CGPoint)locationFromTouch:(UITouch *)touch | |
| { | |
| CGPoint touchLocation = [touch locationInView:[touch view]]; | |
| return [[CCDirector sharedDirector]convertToGL:touchLocation]; | |
| } | |
| - (BOOL)containsTouchLocation:(UITouch *)touch | |
| { | |
| CGRect selfRect = CGRectMake(self.position.x, self.position.y, self.contentSize.width, self.contentSize.height); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| - (void)turnCard | |
| { | |
| if ([self isFaceUp]) { | |
| [self flipHide]; | |
| self.faceUp = NO; | |
| } else { | |
| self.faceUp = YES; | |
| [self flipReveal]; | |
| } | |
| } |
NewerOlder