I got 两处原始财产:
@property (readwrite, assign) int Figure1;
@property (readwrite, assign) int State;
页: 1
@synthesize Figure1;
@synthesize State;
然后,我去了。
UISwipeGestureRecognizer *swipeLeft =
[[[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(swipeLeftMade:)] autorelease];
[swipeLeft setDirection:UISwipeGestureRecognizerDirectionLeft];
[self addGestureRecognizer:swipeLeft];
以及
UITapGestureRecognizer *oneFingerTwoTaps =
[[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(ooneFingerTwoTaps)] autorelease];
[oneFingerTwoTaps setNumberOfTapsRequired:2];
[oneFingerTwoTaps setNumberOfTouchesRequired:1];
[self addGestureRecognizer:oneFingerTwoTaps];
入门。
所用方法:
- (void)ooneFingerTwoTaps
{
[NSThread detachNewThreadSelector:@selector(oneFingerTwoTaps) toTarget:self withObject:nil];
}
- (void)swipeLeftMade:(UISwipeGestureRecognizer *)recognizer
{
[NSThread detachNewThreadSelector:@selector(moveLeftSwipe) toTarget:self withObject:nil];
}
在第一版,主要计划是:
- (void)oneFingerTwoTaps
{
PlayScene *tView = [[PlayScene alloc]initWithFrame:CGRectMake(0, 0, 320, 420)];
[self addSubview:tView];
while (GameState==GamePlaying) {
Figure1 = 1; State = 1;
[self moveFig];
}
}
在第二版中,我需要使用在第一版上改变的财产价值。
-(void)moveLeftSwipe {
int fset = State, figure=Figure1;
//some other stuff
}
但问题是,地产的价值在胎面之间是一片,我被告知,“非生物”可能会造成这一问题,但我没有使用。 难道我可以说是错了吗?