![]() ![]() Also, the part of the program that handles events must check to see if your input should affect the menu or the game. Everytime through the game loop, the program must check to see if it should display the menu or simply draw the next frame. Then the game begins, and loops until the game is over. Then the menu is displayed until a selection is made. The program begins in the intro state and loops until a key is pressed. The traditional way of handling multiple states is with a series of if statements, switches, and loops. For example, you can usually bring up the menu during game play. In most games it is possible to be in more than one state at a time. When you're finally defeated, the game moves to a game-over state, usually followed by a return to the menu. Every game starts off in an introduction state, then moves to a menu of some kind, a finally play begins. Multiple states are not only important in demos, but also in games in general. ![]() I remember thinking it was like they took several different programs and tied them together. They would go from some swirling 2D effect, straight into a 3D rendered environment. Anyway, these demos have a way of moving seemlessly from one effect to another. Not a demo as in "a preview of an upcoming game", but a demo as in "old-school, from the scene". The first time I became fully aware of different states in games was while watching a demo years ago. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |