Starter

Have a go at these games to revise your angles!

Kung Fu Angles Game Maths Degress Quiz

angles

Main Activity

Work you way through the Blockly Pond Tutor following the link below.

As with the previous lessons, make sure that you upload your code to the QuizMaster site.

Blockly Pond Tutor

blockly-pond-tutor-ch1

The Canon

pond-canon

The Blockly Pond cannon has two required arguments.

  • The direction the canon is to fire in.
  • The distance the canon is to fire.

blockly-canon-explanation

Scan()  ===> Return the distance to a duck (if found)

scan

The scan function looks in the direction indicated and if it finds a duck, it returns the distance to the duck. If it doesn’t find a duck it returns infinity(or doesn’t return a value??).

scanwithcanon

The scan is very useful when used inside a cannon block ( set to the same angle). The scan block feeds the return value out from the inner block to the outer block.

The result? The code scans for an enemy and if it finds one it shoots in exactly the correct direction and distance!

In this example if the red duck scans at 45 degrees it will return the distance to the yellow duck. Otherwise it will return infinity.
In this example if the red duck scans at 45 degrees it will return the distance to the yellow duck. Otherwise it will return infinity.

Assessment

Load your completed challenges on to the Quizmaster site.

quiz.mr-west.uk

Homework

Finish off your challenges and make sure you click save and submit on your work