Time to Play!

During the third week of this program, you will code your team players and have a first trial run of your program. This week's Intramural Competition will allow you to try out your ideas and see what works well and what doesn't; the best code from the Intramural Competition will be submitted to a practice Regional Competition at the end of the week.

By the end of this week, you should:

  • Understand the more complex math and physics concepts involved in maneuvering the SPHERES satellites, including kinematics:
    • Mass vs. weight
    • Speed vs. velocity
  • Code your intramural game strategy for the Intramural Competition!
  • Understand how, and be able, to write and debug code using the ZR game controls in the ZR IDE for your player
  • Be able to work in teams to solve problems related to activities and your ZR game strategy and coding

Now, let's get started developing your program!

What Do You Already Know About SPHERES?

  • While there are eight controls in the ZR IDE that allow you to maneuver and manipulate the SPHERES, you will only use four of them in your program: setPositionTarget, setAttitudeTarget, getMyZRState, and getOtherZRState.
  • Look at the All About the SPHERES slideshow to find out more about how the SPHERES know where they are and how they control their position.

Complete this tutorial to learn to use a for loop to repeat an action a set number of times–in this case, to find the position of the second satellite and program your satellite to move toward the second satellite, but stop halfway

What would it take to leap into the future? You would need to achieve warp speed! Is it possible? To find out, review this slideshow.

Kinematics, or the study of motion without considering the forces that cause that motion, are important when you create your program for the SPHERES. If your program tells the SPHERES to move to a point, it will activate its thrusters to create a force that will move it in that direction. Once it reaches the point, it will stop activating its thrusters. But the satellite will continue to travel in the same direction unless it is given a command to stay at that point (in which case it will activate the necessary thrusters to keep it at that point). To see the effect of motion on your satellite, try the simple Hints About SPHERES Loop Dynamics tutorial.

In order to be successful in ZR, you need to program your player to do different things depending on where it is and where the other player is. As you've already learned, the SPHERES Control "getMyZRState" tells you the following information about your satellite:

  • Position–where the satellite is in the game area
  • Velocity–how fast and in what direction the satellite is moving in the game area
  • Pointing vector–which way the satellite is rotated (that is, where the side with the velcro is pointed within the game area)
  • Rotation rates–how the satellite spins about any of its three axes (x, y, or z)

You can use this information in conditional statements to implement your player strategy–learn how with this tutorial!

How can you organize and keep track of everything that is happening in your code? Using functions! Learn how with this two-part tutorial. In the first part, Creating Functions, you will learn the basics of creating functions; in the second part, Functions and the Step Counter Model, you will learn how–and why–to use a step counter model in your program, and practice creating functions.

First, follow the instructions in the Intramural Game Mode tutorial to learn how to share your game code with the group. Then watch as your leader follows the instructions in the How to Submit Code tutorial to begin the Intramural Competition!

While your major job in Week 3 is to strategize and program your player for the first round of competition, you also need to take a break sometimes and have fun. Try spending some time with the following activities, videos, and fun quizzes:

Explore Forces and Motion

Some more math and science fun