Scratch game making tutorial 120b

Love calculator advanced - who loves who?

In this tutorial you will make a game that lets you find out how much 2 people love each other!


Complete these steps ..


1. Download and save these three stage background images ..



2. Create a new game, then select the stage, and then click the background tab. Import the three background images ..

Now, delete the white one.



3. Add these scripts to the stage ..



4. We need three variables for this game. 2 variables for the names and one for the love score.

Create these variables ("for all sprites") ..

Make sure they are hidden on the stage (unticked).



5. Select the cat sprite and re-name it "Cat". Now add these scripts to set the size and position of the cat ..



6. Now, press the "B" key to test your game. Press "E" to end when you are done.

Use "File>Save as" to save your game. Name it "Love calculator".



7. The cat will ask the player to enter the names of the two people that we want to find out about.

We will use some "ask" script blocks for this. After the player types in the names the game will store them in the "1st name" and "2nd name" variables.

To begin with add a script that sets the "love score" to none ..


Now add on a "forever" script and the "ask and wait" scripts that ask the player to enter the 2 names. Notice how after each "ask and wait" script the answer is stored in the variables "1st name" and "2nd name" ..


Next, we need to add the "set" script that chooses a percentage value between 0 and 100 for the "love score" ..


Finally we need the cat to tells us how much the 2 people love each other. If the score is 50 or more the cat will say one thing, and if it is less than 50 it will say something else.

Add the "if else" script below. We will create two sentence for the cat to say with "say" and "join" scripts.

Take care to add a space (spacebar) before and after the words that need it ..



8. Now, press the "B" key to test your game. Press "E" to end when you are done.

Use "File>Save" to re-save your game.



9. A nice final touch is to make the stage background change depending on the love score.

Select the stage and add this script ..



10. Use "File>Save" to re-save your game.

Well done. You've finished. Press the "B" key to test your game. Press "E" to end when you are done.



11. Can you make this game better?