CLICK SPACE You are going to create a simulation for Grade 1 students about an automatic railway gate, using Scratch. The simulation shows the gate opens when the train crosses sensor A then close when the train pass by sensor B. The simulation runs continuously. 11 The simulation starts when space key pressed Follow the steps below: Open Scratch file ‘railway simulation.sb’ from the Support files folder on the Desktop. Save the Scratch file in the Support files folder as ‘railway simulation -your name’ [1] 12 Import ‘train.sprite' as a sprite from Support files folder. [1] 13 On the ‘train' sprite. (a) Create a script to do the following: o Start in the position x = 315 and y = -16 o Move 1 step continuously. [3] (b) Create another script to do the following: o Move horizontally through the stage. o Disappear at the end of the stage then reappear at the beginning of the stage continuously. [5] (c) Create another script to do the following: o Continually check the train position. When the train starts crossing sensor A, broadcast the message ‘open’ You can use x position if needed. [3] o Continually check the train position. When the train finishes crossing sensor B, broadcast the message ‘close’ You can use x position if needed. [3] 14 On the gate sprite create a script do the following tasks continuously. Switch to costume 'gate 2' when receiving broadcast message open Switch to costume 'gate 1' when receiving broadcast message close Save the changes you have made.
ALL CREDITS GO TO CAMPBRIDGE lol XD