As you will see yourself, quite a few things look similar to the city
class definition and its wrapper functions. However, the launchers are different objects, and so we need different methods and functions for them. Not every step of code is explained now, as some is the same as for the city
class.
1. Create an empty script and save it under the name
launcherClass.monkey
.2. At the beginning of the script, tell Monkey to switch into
Strict
mode and import thegameClasses.monkey
file.Strict Import gameClasses
3. Create a new list that stores all instances of the
launcher
class.Global launchers := New List<launcher>
Launchers will have to be updated for each frame, so we will have a new wrapper function to call the corresponding method for all existing launchers.
4. Create a wrapper function called
UpdateLaunchers
. In it, we will loop through the launcher's list and call theirUpdate
method.Function UpdateLaunchers:Int() 'Loop through...