The goal of Planet HEXBUG is to stay alive as long as possible. In order to survive on Planet HEXBUG, the VR HEXBUG nano has to find, collect, and eat food.
Why Collect Food in Planet HEXBUG?
As the VR nano travels in Planet HEXBUG, its power drains and the robot requires food (batteries) to restore that power. The VR nano uses built-in AI technology to detect food, and when found, it can either eat the food immediately, carry it, or deliver it back to its home through the Planet HEXBUG environment.
Eating food installs a new battery in the VR nano, and restores its battery life to 100% immediately.
Collecting food and carrying it home will give the VR nano Experience Points (XP). XP is used to increase the VR nano’s strength, enhancing its ability to defeat enemies and carry more food.
For information on using XP to level up your VR nano, see this article.
Sensing, Collecting, and Eating Food
The VR nano uses built-in AI technology to locate and move towards food. The robot can detect food in a 360 degree radius. See this article for more information on the AI features of the VR nano.
Once food is detected, the VR nano can be coded to travel toward the food. When the robot reaches the food it can either eat the food immediately, pick it up to carry it, or drop the food when it is delivered home.
The following example projects show how you can put it all together to have the VR nano detect food, travel to it, then either eat it or pick it up and deliver it to its home.
- Example projects can be used as a starting point for your code. See this article for more information on accessing and using example projects in VEXcode VR.
Finding Food Example Project
In this project, the VR nano will travel towards the nearest piece of food. Once the robot reaches the food, it will eat it.
Bring Food Home Example Project
In this project, the VR nano will travel towards the nearest piece of food. Once it has the food, it will use built-in AI technology to travel home. The VR nano will then drop the food and add it to the food storage.
Food Decision Example Project
This project will have the VR nano move towards food and make a decision on whether to eat it or pick it up to carry it back to its home.
Once the robot reaches the food it will make a decision:
- If the battery life is greater than 50%, it will pick up the food.
- If the battery life is less than 50%, it will eat the food.