5 assignment


1- Open Scratch

2- Get rid of sprite 1 (orange cat), to do it we have to click on it with the right button and delete. Then to create a new one we have to click on the brush, to create a rectangle click on rectangle and draw it large overlapping the middle point, then fill it with colour. To do it smaller click on shirk and then click again on the rectangle.

3-Go to scripts, click on events and drag the green flag on the panel, then go to control and drag forever (select it and drop it).

4- To create a variable go to data, and select make a variable. On the variable name write SPEED and click OK.

5- To move the padel go to motion and click on change x by (select it and drop it).

6- Put forever under the green flag and change x by inside forever. To link the variable to all the commands go to data, select SPEED and drag it inside change.

The paddle - copia (2)

7- We are going to make another block of commands. Go to events, select the green flag and go to control and select forever else and if then that it is also in control.

8- The next thing we have to do is to go to sensings ans click on key pressed? and drag it inside if then. Click on the right arrow of space on key pressed? and select right arrow.

9- Go to data and select set speed by 1 and drag it between if then and else, drag the if then inside the forever and forever connected to the green flag.

10- Then go to control, select if then and drag it between else and the low part of it.

11- Go to operations and fill if then with it.

12- Then go to data and, select SPEED and put it (image) then write in the other side 0 and in data, select change speed by 1 and drag it inside inside of if then and write -1.

13- To insert a delay go to control and click on wait secs and write 0 in addition you have to go to data and select set speed to 0 and drag it between the green flag and forever.

Now when you click on the right arrow of the the palet will move to that side and you can increase the speed by clicking for a long period of time on the arrow.

The paddle - copia


14- For the palet to move on the other direction cover over the green flag and with the right button of your mouse and click duplicate. Change key right arrow to left arrow, write in SPEED -1 instead of 1 and change the SPEED of the if then to the other side, remember to write a 0 in the first blank space of it and also in change SPEED write 1 instead of -1. This was the last change.

The paddle

Now it will move to the left and right.

15- We are going to create a new sprite, go to paint a new sprite and draw a circle. Remember to draw it over the middle point. Click to shrink to do it smaller.

16- Now we are going to program the new sprite, go to scrips (make sure that you are programming the right sprite) events and select the green flag and then go to control and select forever.

17- Go to motion and select point in direction and now write on it 135 instead of 90 and connect it with the green flag.

18- Go to motion and select go to x: y:. In y: write -25.

19- Then go to operators, select pick random and drop it inside x:and write in the first value -230 and in the next one 230. Match go to point in direction

20- To install a delay go to control, select wait one sect and write 0.5 instead of 1. Connect the forever with wait secs.

21- Go to motion, select move 10 steps and drag it inside forever. Scroll down and select if on edge bounce and drag it inside forever but under move steps and write in point direction -35 instead of 135.

22-  Go to events and select green flag and control, select forever and if then. If then must be inside forever and connected to the green flag.

23- Sensings, select touching and put it on sprite 1.

the block of the ball



24- Select sprite 2: we are going to tell the computer that when ever the ball touch the palet it has to bounce. Go top motion, select point in direction 90 and drag it inside forever.

25- Go to operators, the addition and multiplication.

26- Go to motion, direction and fill the first part of multiplication with that and in the second gap write 1 and then drag the addition next to -1. Fill the second part of addition with 180 and fill the blank part with the formula of point in direction.

second block of commands


27- Create a new sprite to tell the computer that when ever the ball touch the bottom line the game has to finish.

28-We are going to say the computer that whenever touches the line the ball, the game restarts.

29-Then we go to scripts (with the line selected), go to events and select the green flag and go to control and select forever and if then and drag it.

30-Next join the forever to the green flag and the if then inside the forever. Go to sensings and select touching in addition display the options and choose the one of the ball.

31-Go to control and choose the command stop all and put it inside the if touching?

The loser liner

32-We are going to make the wall of bricks. First we have to make a new Sprite so click in the brush and select rectangle (you have to have selected fill the rectangle). Then go to shrink and click several times on it to make it smaller.

33-Then we have to go to Scripts click on data to make a new variable, select SCORE. We drag set SCORE to 0 and change SCORE by 1. We connect set SCORE to 0 with the green flag.

34-Go to control select if then and drag it inside forever, and join forever to the set green flag.

35-Go to sensings, select touching and drag it inside if then (selecting Sprite 2. )

36-In looks drag hide inside the if then. And drag show between the set and the forever.Any brick

37-To finish ,we have to duplicate the Sprite of the brick as many times as we need, to make a brick wall. Be careful, you have also to duplicate the second block of commands of the ball and instead of if touching the Sprite 1, change to touching the Sprite 4 (you have to do the same in all the blocks that you want to make).

ball programIt has to look something like this.