For original script description, you should refer to Redware's website. Here I just want to shortly explain & summarize the script blocks above.
Shark Sprite:
- If the green flag is clicked, "score" variable is set to 0; the shark will begin its exploration by following mouse-pointer
- If the shark receive "sharktouchingyellowfish" message, it will animate 3 times before it looks normal again
- If the shark receive "sharktouchingredfish" message, the score will be reset to 0 and the shark will take another (sad-looking) costume for a while
Other Fish Sprites:
- If the green flag is clicked, each sprite will sense if it has been eaten by the shark (i.e. touching shark); if not, it just randomly take a direction and move forward
- If a fish meets the shark, it broadcasts the "sharktouchingXXfish" message and hides for a while but appears again from a random position at the left or right side; in this case the score is incremented
No comments:
Post a Comment