Intro to Swimming Orca

Overview

  • Program the Orca to swim in a circle once, then have it follow where your fingers touch the screen. Complete two additional challenges to make the Orca swim in a circle forever, and see if you can program it to swim in a Figure 8.

Objectives

  • Become familiar with visual programming.

  • Program the Orca to swim using basic motion commands.

  • Understand sequential execution of commands and repetition (forever and repeat loops).

  • Understand the concepts of Cartesian coordinate system.

Steps

Create an Orca Project

  • Open Tickle app and go over the welcome tutorial that shows you how to drag and drop coding blocks. You can replay the tutorial in Settings -> Show Introduction as needed.

  • If you don't already have a Orca project open, create a new one by tapping + New Project in "MY PROJECTS". Choose the template with the name "Orca".

Let's Swim!

  • Tap the green Play button and see how the Orca swims in a circle.

  • Move your fingers to different parts of the ocean, and see how the Orca follows your fingers.

Swim and Follow Finger Touches

  • To make Orca swim in a circle, we program the Orca to move forward 10 steps, and then turn by 10 degrees. Because turning a full circle is 360 degrees, we need to repeat the move and the turn blocks 36 times each.

  • Here we use the repeat 36 times block, and add the move and turn blocks inside this yellow block so that each will executed 36 times.

  • To make the Orca forever follow your finger touches on the ocean stage, add a forever block and add the go to ... block inside it. Set the go to ... block to go to last touch point.

  • Tip: try changing the number of steps to 20 and see what happens. Change the number of degrees to 20 and see what happens.

Challenge 1: Make the Orca Swim in a Circle Forever

  • Tip: By adding a forever block around the repeat 36 times block, the Orca will continue to swim in circles forever (until you hit the Stop button).

Challenge 2 (Advanced) : Make the Orca Swim in Figure 8.

  • A figure 8 is composed of moving in two circles, with the second circle in the opposite direction. In the following sample code, the Orca turns right by 10 degrees each time for the first circle (clockwise for 360 degrees). It then changes direction, and turns left (counter-clockwise) for 360 degrees.

Tickle’s Coordinate System

  • The coordinate system of Tickle is a 2-dimensional Cartesian coordinate system. The origin (0, 0) is at the center of the stage.

  • The X axis ranges from -240 to +240, and the Y axis ranges from -180 to +180.

  • All characters starts with a direction of 0 degrees. The degrees increases counterclockwise from 0° which points to the right.