Castle Crasher
Lesson 3: Castle Crasher + Distance Sensor

# Practice

In the last section, you learned how to use the Distance Sensor to measure distance, to detect objects and their relative size, and to report object velocity. You learned how the Distance Sensor works, and how to code it using VEXcode IQ. In this activity, you will apply what you've learned to code your robot to to locate a cube and push it off the Field.

In the practice activity, you will create a VEXcode IQ project to locate a cube and push it off the Field, making sure that the robot itself does not fall off the edge of the Field. You will iterate on your project to ensure the robot can complete this task even if the cube's starting position is changed. Watch the video below to see how you can apply what you have learned to complete the Push it Off practice activity.

Now it's your turn to complete the Push it Off Practice Activity!

In this animation, the robot turns in the direction of the cube, drives towards it, and pushes it off the Field.  Then the robot and cube are reset, with the cube in a different position this time. The robot rotates towards the cube and pushes it off the Field. This animation shows one example of how a project can be created to complete the Push it Off activity.

Use this document as a reference to complete the practice activity.

As you complete the Push it Off activity, document your projects and tests in your engineering notebook.

• Draw a picture to show how your robot should move to complete the activity
• List the steps needed to create a project based on your picture
• Document the changes you make after each iteration

See the image on the left for an example of how you can record your project ideas and tests.

In Compete (on the next page), you will code your robot to knock four cubes off the Field as quickly as possible in the Cube Crasher Challenge. Learn how to complete the challenge, check your understanding, then practice for the challenge.

The goal of this challenge is to have your robot push all four cubes off the Field as quickly as possible, without falling off the Field.

Watch this animation to see an example of how your robot could move to complete the Cube Crasher Challenge.