Since we are writing several scripts, we should stay organized. We can click Favorites | All Scripts in the Project panel to get a list of all the scripts in our project, but there are a lot of them, most of which we will not edit for our game. So, let's create a folder in the Project panel to organize our custom scripts. Here are the steps:
- In the Project panel, right-click the Assets folder
- Select Create | Folder
- Name the new folder Custom Scripts
Now that we have a folder for our custom scripts, let's move a few:
- In the Project panel, click Favorites | All Scripts.
- Scroll until you find the BeetleNPC script we created earlier in this chapter.
- Drag the BeetleNPC script to our Custom Scripts folder. This moves the BeetleNPC script to the designated folder. You will still see it in Favorites | All Scripts because this feature shows all scripts regardless of their location.
- Move the CameraFollower script to the Custom Scripts folder.
- Move the PlayerController script to the Custom Scripts folder.
- Move the PlayerMotor script to the Custom Scripts folder.
When you are done moving scripts, your Cucumber Scripts folder should be the same as the following screenshot:
Our beetles will have the following behaviors in our game:
- Search for cucumbers (patrol)
- Eat cucumbers when found
- Defend itself from the Cucumber Man on the ground
- Stand to defend itself from the Cucumber Man
The next sections will show you how to script these behaviors.