开发者

Cocos2d gameClock update function not working

开发者 https://www.devze.com 2023-03-02 15:41 出处:网络
gameClock is defined the header file @interface UserInputLayer : CCLayer { ccTime gameClock; } In the init method of the layer I have:

gameClock is defined the header file

@interface UserInputLayer : CCLayer
{
    ccTime gameClock;
}

In the init method of the layer I have:

[self schedule:@selector(updateClock:)];

updateClock looks like this:

-(void)updateClock:(ccTime)delta {
    gameClock += delta;
 }

but I am getting the error:

Signature not found for selector - does it have the following form? 
-(void)开发者_StackOverflow社区 name: (ccTime) dt


Although I have not used Cocos2D, I would bet that this is because updateClock: is not declared in your header, like this:

@interface UserInputLayer : CCLayer
{
    ccTime gameClock;
}

-(void)updateClock:(ccTime)delta;

@end


Use [self scheduleUpdate] instead.

0

精彩评论

暂无评论...
验证码 换一张
取 消