A complete RPG game consists of basic elements such as roles, AI, props, maps. The current RPG game has a wide variety of RPG games, but the same is the framework of the game. When a game is determined, this game's production ideas will be Will look very clear. Below I give a core operation of a game:
public void run () {long startTime = 0; long interval = 1000 / this.m_nFramePerSecond; long endTime = 0; long lagTime = 0; this.showState (KGameState.MD_COVER); // initialize a first state of Thread currentThread = Thread.currentThread (); while (true && currentThread == Thread.currentThread ()) {startTime = System.currentTimeMillis (); this.keyAction (); this.gameAction (); if (this.m_bRepaint) this.flushGraphics ( ); endTime = System.currentTimeMillis (); if ((lagTime = endTime - startTime) GameAction () The logical operation of the game itself, these operations should belong to the game system itself, not part of the user's interaction; FlushGraphics () performs interface redraw. Developers should let M_Brepaint will redraw M_Brepaint when needed. Because the different features are divided into different game states, it is necessary to control the transformation of the game status. The functionality to be implemented is: Set the current state, get the current state, get the previous state, save the game status , Load the game status. There is also an initialization operation to a state (showState ()). Such a game frame is established.