-
Notifications
You must be signed in to change notification settings - Fork 72
Introduction
MegaMech edited this page Jul 12, 2022
·
12 revisions
Any useful or helpful tidbits of information of how the game works. The being that if someone looked at the code-base for the first time. They could read this and gain a visual picture of how the game flows.
mk64 runs its loop in the following pattern:
init_threads()
game loop:
audio?
jumpTo menus/race if var is updated
profiler
config_gfx_pool
read_controllers
game_state_controller
endDL/vsync
game_state_controller:
switch(loc)
menus -> switch(menu) { // do menu stuff }
race_logic_loop -> spaghetti
ending_sequence (trophy scene)
credits
As you can see, it's a relatively primitive design. Its level of abstraction could be defined as a state machine. Versus an OOP design that uses objects and hierarchy.
If mk64 is in a menu state. Then menu related code is ran, and this branches off continuously running relevant bits of code depending on factors such as which particular menu the user is in. If mk64 is in a race state, then race related code is ran and it spaghetti's off into a wide series of branches.