5,389
edits
Line 29: | Line 29: | ||
# REST OF THE MAIN FUNCTION'S BODY, UNCHANGED | # REST OF THE MAIN FUNCTION'S BODY, UNCHANGED | ||
} | } | ||
This is an inline call to the <tt>pre</tt> function we have just set up in the global folder. The function <tt>pre</tt> is | This is an inline call to the <tt>pre</tt> function we have just set up in the global folder. The function <tt>pre</tt> is "globally recognized". | ||
===Why call it <tt>pre</tt>?=== | ===Why call it <tt>pre</tt>?=== | ||
Because everything in <tt>func main</tt> is level-specific settings and/or logic, so if you want something to happen exactly the same every time you load a level, the only place to add that something is at the very start of <tt>func main</tt>, that is, ''before'' all the level-specific content. Which is why it's called "pre". | Because everything in <tt>func main</tt> is level-specific settings and/or logic, so if you want something to happen exactly the same every time you load a level, the only place to add that something is at the very start of <tt>func main</tt>, that is, ''before'' all the level-specific content. Which is why it's called "pre". |