Tuesday, March 25, 2008

Scratch Challenge (1):

The challenge is to make 2 different balls move around on the stage. You have to make the first ball move in straight lines but bounce randomly whenever it hits the edge. You have to make the second ball move randomly and make it change its direction all the time.


(1) Click on the folder: 'Choose new sprite from file'. Click on: 'Things' and choose two different balls. Now click on: 'Shrink sprite' and keep clicking on the first ball until you shrink it to a reasonable size. Repeat this for the other ball.


(2) To make the first ball move, click on: "Control" and place 'when clicked' into the first ball's script. Now place 'forever' in the script underneath 'when clicked'.


(3) Click on: "Motion" and place 'move (10) steps' in the script underneath 'forever'.


(4) Click on: "Control" and place 'if' underneath the script from step (3).

(5) Click on: "Sensing" and place 'touching (edge)' next to 'if'.


(6) Click on: "Motion" and place either 'turn anti-clockwise (15) degrees' or 'turn clockwise (15) degrees' underneath the script from step (5).

(7) Click on: "Numbers" and place 'pick random (1) to (10)' next to 'turn (15) degrees'. You can change it to (1) to (90) degrees. Now when you double click on: 'when clicked' your first ball should move in straight lines but bounce randomly whenever it hits the edge.



(8) To make the second ball move, click on: "Control" and place 'when clicked' in the second ball's script. Now place 'forever' in the script underneath 'when clicked'.



(9) Click on: "Motion" and place 'move (10) steps' underneath the script from step (8). Now place either 'turn clockwise or anticlockwise (15) degrees underneath 'move (10) steps'. Now place ' if on edge, bounce' underneath this.
(10) Click on: "Numbers" and place 'pick random (1) to (10)' next to 'move (10) steps' from step (9). Now place another 'pick random (1) to (10) next to 'turn (15) degrees'. You can change it to (1) to (90) degrees. Now when you double click on: 'when clicked' your second ball will move randomly and change its direction all the time.



(11) Click on the green flag and both your balls should move together at the same time.

1 comment:

Unknown said...

I have marked this one now

See me about the long spaces underneath some of your blogs