Step 1: Creating Variables for the Fish

Goal:


Let’s start by creating our variables for the fish.

These variables will control the speed of the fish in the x and y direction.

Steps:

  1. Select the “Fish” sprite.
  2. In Variables, click on Make a variable.
  3. Create 2 new variables and call these “xSpeed” and “ySpeed”.
  4. Be sure to select “For this sprite only” and be sure you are on the “Fish” sprite.

Code:


Click to replay