package com.example.first_game;
import org.cocos2d.layers.CCScene;
import org.cocos2d.nodes.CCDirector;
import org.cocos2d.opengl.CCGLSurfaceView;
import org.cocos2d.layers.CCLayer;
import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
public class MainActivity extends Activity {
private CCGLSurfaceView view = null;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
view=new CCGLSurfaceView(this);
setContentView(view);
CCDirector director=CCDirector.sharedDirector();
director.attachInView(view);
director.setDisplayFPS(true);
director.setAnimationInterval(1/30.0);
CCScene scene=CCScene.node();
game w=new game();
scene.addChild(w);
director.runWithScene(scene);
}
}
public class game extends CCLayer{
public game(){
}
}
最簡單的程序,初始化一個窗口場景。你的問題是什麼?如果一竅不通,找一本書系統地學下。