Animated Title Maker pt.2

St Patrick’s Online Coding Lessons with Mr Darch

Animated Title Maker pt.2

In part 2 of this project we’ll add a second word and code keys on our keyboard to switch between them. Then we’ll create a “follow the leader” effect where the first letter of our word moves to a random position on the stage and then the whole word moves letter by letter to where the first letter now is! We could use these projects to create titles and credits that we could use in presentations, animations or movies we’ve created as well as other Scratch projects!

Notes for parents: Each child will work at their own pace on this. I’ve uploaded video and written instructions for each step. With Scratch children ideally need access to a keyboard to name sprites and enter numbers but much of this project can be done on an iPad or tablet without any issue.

Children should be encouraged to work at their own pace and enjoy playing with what they’ve made as they go. Do encourage them to watch the video for each step again if they get stuck. Some will complete this is in half an hour, others might like to come back to this project 3 or 4 times to complete it. 

Please direct any feedback or suggestions to dave@alittlelearning.org

Happy Scratching!

We are learning to:
  • Code loops to control movement of sprites
  • Use both local and global variables to make information available to other parts of our program. 
  • Use variables to track the state of something ie. on/off
  • Use X and Y co-ordinate systems to control where we want our sprites to start and move to
  • Use random number generators in our programs to create interesting outcomes
  • Use the Scratch programming language to solve computer science problems in a fun and engaging way
  • Write code to control each sprite (letter) in the game
  • Control our program with user input (key stroke presses)
  • Initialise code in our game to ensure that sprites are in the right place

Getting started

We’ll be using the free web app at www.scratch.mit.edu again for this lesson. You don’t need an account to take part.

Try to watch each video a few times before you read the instructions. This will help you to clearly understand what you need to do.

What we’re making | preview

Step 1

Add a second word

  • Make space for the new word
  • Move the word you already have to where you want it
  • Adjust the X or Y position in each letter’s code of the first word
  • Choose the letters you need
  • Drag them to where you want them on the stage

Step 2

Code the second word

  • Space key pressed
  • Set size to 
  • Go to X Y
  • Copy to each sprite in the new word and use it’s unique X, Y position block

Step 3

Code the random position and glide back scripts

  • Copy the [when up arrow key pressed go to random position] script from the first word sprites to the new word sprites
  • Do the same with down arrow key pressed and glide to X Y
  • Update the XY for each new sprite letter in the new word

Step 4

Code words to appear and disappear

  • Create local variable called ‘hidden’
  • Copy the script as shown in the video and below

Remember! 

For all sprites = global, For this sprite only = local

Global means that any sprite can see the value stored in the variable.

Local means that only that sprite can see the value. Every sprite can save it’s own value to it’s own version of that variable.

Step 5

Choose which code you want to copy to the new letters

  • Do you want the ‘A’ and ‘S’ key to make the letters bigger and smaller?
  • Do you want the letters to wobble side to side like a stop motion animation?
  • Do you wan the right arrow to change the colour effect?

 

Step 6

Follow the leader
  • Let’s make our new word play follow the leader with the first letter
  • Create variables, wait time  and wait multiplier For all sprites. These are global sprites
  • Create a variable called letterOrder. This is For this sprite only as each sprite will have it’s own unique position in the line
     

Step 7

Set letter order for each sprite
  • Copy the script as shown in the video

Step 8

Code each letter to follow the first sprite in turn

  • Create the script as shown in the video
Key learning:

Did you play the game?

What happened when the red dot sprite touched the bug sprite?

That’s right NOTHING!

Why not? Because we haven’t written any code to make that happen!

We need to add more code to make something happen when these sprites touch.

Extension Challenges:

  • what other ways would you want your letters to move?
  • could you make your letters all go to the same place and explode out to their correct positions in the word?
  • could you get your letters to bounce off each other?
  • could you create an anagram where more than one word can be spelt by the same letters?
  • could you use a variable to control the amount that the stop motion effect turns?
  • could you use a variable to control the horizontal position of the whole word?
  • could you use if/else to make certain things happen when other conditions are TRUE? eg. if letters are touching each other then move apart, if letters are over a certain size bring them back to their intialised state?