1、GameLayer
package com.njupt.schedule01; import org.cocos2d.actions.interval.CCJumpTo; import org.cocos2d.layers.CCLayer; import org.cocos2d.nodes.CCSprite; import org.cocos2d.types.CGPoint; import android.view.MotionEvent; public class GameLayer extends CCLayer{ public GameLayer() { this.setIsTouchEnabled(true); //每个1秒钟调用一次fun方法... this.schedule("fun",1); } /** * delta表示本次调用与上次调用的时间差 * @param delta */ public void fun(float delta){ System.out.println("我爱章泽天... "+delta); } @Override public boolean ccTouchesBegan(MotionEvent event) { this.unschedule("fun");//取消时间调度.. return super.ccTouchesBegan(event); } }