// elapsedSeconds : 전 프레임에서 지난 시간 public void UpdateWorld(float elapsedSeconds) { if (!isPlaying) { if (GmfKey.IsKeyPressed(Keys.Enter)) { isPlaying = true; world = new GameCore.World(); } else { return; } } if ((int)(totalElapsedSeconds / updateInterval) != (int)((totalElapsedSeconds + elapsedSeconds) / updateInterval)) { isPlaying = world.Update(); } totalElapsedSeconds += elapsedSeconds; }
private void MainForm_KeyUp(object sender, KeyEventArgs e) { GmfKey.SetKeyPressed(e.KeyCode, false); }
private void MainForm_KeyDown(object sender, KeyEventArgs e) { GmfKey.SetKeyPressed(e.KeyCode, true); }