//处理各项命令 public void DealWithCommand() { switch (Option.Command) { case Menu_Command.Start: _system.ChangeState("Stage1"); soundmanager.Stop("victor01"); break; case Menu_Command.OptionChanged: System.IO.StreamWriter writer = new System.IO.StreamWriter("opst.dat"); writer.WriteLine("$volume#" + (soundmanager.Volume + 1).ToString()); writer.Dispose(); break; case Menu_Command.CharactorSelect: break; case Menu_Command.Quit: if (form != null) { form.Close(); } break; } Option.Command = Menu_Command.None; }
public void Update(double elapsedTime) { _delayInSeconds -= elapsedTime; if (_delayInSeconds <= 0) { _delayInSeconds = 3; _system.ChangeState("title_menu"); } }
public FileManager filemanager; //本地资源管理器[1.0] public Form1() { InitializeComponent(); //初始化bass库 BassNet.Registration("*****@*****.**", "2X52314160022"); this.Text = "Stay Night"; _fastloop = new FastLoop(GameLoop); //绑定循环 //lp = new LoopTread(this); //loopthread = new LoopTread(GameLoop); _openGLControl.Dock = DockStyle.Fill; //保持为父容器填充 _openGLControl.InitializeContexts(); //OpenGL初始化(比c++方便了不少) filemanager = new FileManager(); LoadingSetting(); //读取用户设置 InitializeDisplay(); //读取资源 InitializeSounds(); InitializeTextures(); //角色初始化 InitializeGameCharactors(); //游戏场景 InitializeGameState(); Gl.glDepthMask(Gl.GL_TRUE); //设置深度缓冲为可读可写 //glDepthMask(GL_FALSE);可将深度缓冲区设置为只读形式 //键盘控制初始 InitializeKeyManager(); Gl.glEnable(Gl.GL_TEXTURE_2D); _system.ChangeState("BattleStage1"); // _system.ChangeState("Stage1"); _openGLControl.KeyDown += _openGLControl_KeyDown; _openGLControl.KeyUp += _openGLControl_KeyUp; // _openGLControl.AutoCheckErrors = true; //自动处理错误 _openGLControl.AutoFinish = true; //自动finish _openGLControl.AutoSwapBuffers = true; //Thread loop = new Thread(new ThreadStart(Read)); //loop.Start(); }