Skip to content

title_flow

mzki edited this page Jul 15, 2019 · 1 revision
graph TB
    %% -- Common Template --

    %% nodes
    start(("Start"))
    next_scene_from_common(("Next scene"))
    scene_start_common["goto: scene_start_common()"]

    %% styles
    classDef class_script_call fill:#CAF
    classDef class_routine_call fill:#EE9
 
    %% apply styles
        class scene_start_common class_routine_call

    %% flow
    start --> scene_start_common
    scene_start_common --> |next scene| next_scene_from_common

    %% -- scene specific --

    %% nodes
    next_scene(("Next scene"))
    newgame_scene(("NewGame scene"))
    loadend_scene(("LoadEnd scene"))
    game_quit(("Game quit"))

    next_scene_exist{"next scene?"}
    title_replace_loadgame("script: title_replace_loadgame()")
    title_replace_loadgame_exist{"title_replace_loadgame()?"}
    builtin_print_title["print title_"]
    user_input_number("wait: user input number")
    user_input_number_is{"user input number"}

    clear_game_state["zero clear game data"]
    builtin_loadgame["go to load_game()"]

    %% apply styles
    class title_replace_loadgame class_script_call
    class builtin_loadgame class_routine_call

    %% flows
    scene_start_common --> |continue current scene| builtin_print_title

    builtin_print_title --> user_input_number
    user_input_number --> user_input_number_is

    user_input_number_is --> |"[0] New Game"| clear_game_state
    user_input_number_is --> |"[1] Load Game"| title_replace_loadgame_exist
    user_input_number_is --> |"[9] Quit Game"| game_quit
    
    clear_game_state --> newgame_scene
    
    title_replace_loadgame_exist --> |NOT exist| builtin_loadgame
    title_replace_loadgame_exist --> |exist| title_replace_loadgame

    builtin_loadgame --> |select save data| loadend_scene
    builtin_loadgame --> |back| builtin_print_title

    title_replace_loadgame --> next_scene_exist

    next_scene_exist --> |exist| next_scene
    next_scene_exist --> |NOT exist| builtin_print_title


Loading
Clone this wiki locally