Jungle Scene 2

The Hedgehog has five costumes. The snake has three. We will use all of them at some stage.

The Hedgehog has five costumes. The snake has three. We will use all of them at some stage.

The toucan is perched up on the branch. Tropical bird sounds fill the jungle air. The Hedgehog stirs out of its sleep below the tree and ventures out to forage for food. Meanwhile a snake lurks in the long grass. Hedgehog and snake are unaware of each other until face-to-face when they both take fright. The snake slinks away. The hedgehog shrieks and curls up into the safety of a ball.

As in part 1, we will use broadcasts to modularise the code into short rather than long scripts. Also we will use 4 invisible markers to set locations instead of x, y coordinates.
Make a sprite in the Paint Editor consisting of a very small purple dot. Name it marker1. Script marker 1, with this short script, to mark x, y of hedgehog.

a. Make 4 Marker Sprites and Set them up

 

b. Set up the hedgehog at Marker 1

 

Make a duplicate of marker1 which will rename itself as marker 2. Colour it blue. It will have the same code as the purple marker. Change the go to coordinates of the blue marker to x: -100 y: 0 to give the position of the snake in the long grass. Duplicate again as marker3. Colour marker3 red to mark the position where the hedgehog and snake confront each other. Change the coordinates of the red marker to x: 30 y:-50. Finally make marker4 green with the coordinates x: 135 y:0 to mark the final position of the snake. The ghost effect makes the markers invisible.
The markers need to be in place, before setting up the hedgehog and snake.

c. Set up the snake at Marker 2