Coding a Treasure Hunt

by nathalierun
See Code Download Embed
#SnapCon19 Workshop : Coding a treasure hunt
In Mathematy, kids love puzzle games. They invented the following game: "the treasure hunt".
A pupil known as "the pirate", hides a treasure inside the rectangular schoolyard of the school.
Then, the pirate gives to Oblazo, the player, a special treasure map. This map indicates how Oblazo's distance to the treasure changes when he walks around the schoolyard. He is only allowed to walk on the edge of the schoolyard. Oblazo must use this map and his thinking abilities to find the treasure.
In Snap!, the schoolyard is represented by the stage.
The inner schoolyard is a rectangle at x.px on the left side of the stage, and y.px on the top of the stage.
The treasure has been hidden in the inner schoolyard and Oblazo has to find it by walking along the edge of the inner schoolyard.

The project is based on an activity from:
Sésamanuel de 2nde édition 2014 (french). Éditions MAGNARD. pages 116-117. ISBN 978-2-210-10042-8
Creative Commons license CC-BY-SA
 https://creativecommons.org/licenses/by-sa/2.0/fr/

Created September 23, 2019

Last updated March 10, 2021

Published September 23, 2019